Follow these steps to generate the required libraries for the Microsoft Terminal Services ActiveX control and embed it inside our WPF application:
- The first step is to generate the required libraries of our ActiveX control. This is required to get a managed and Windows Forms compatible definition of the relevant type. To do this, open Visual Studio Developer Command Prompt and navigate to an empty folder (let's say, D:libs).
- Now, in the Command Prompt, enter the following command to generate the managed definitions of the Terminal Service DLL:
aximp c:WindowsSystem32mstscax.dll
- This will generate two DLL files, named MSTSCLib.dll and AxMSTSCLib.dll, in the same folder (D:libs, in our case):
- Let's copy those DLLs in our project folder. Create a folder named libs, inside the root folder of our project, and copy both files there.
- Now, add the references of those binaries into our project. Navigate back to Visual Studio, and from Solution Explorer, right...