Bero
Bero

Reputation: 219

How to compile dynamic virtual channel c++ example from MSDN

On MSDN there is an example in C++ on how to create Dynamic virtual channel plugin.

My problem is that I don't know how to compile it.

Do I need to create an ATL project and in main.cpp copy-and-paste the code found on msdn? What do I call the project? If I create ATL project with name DVCPlugin, than Visual studio 2008 automatically creates DVCPlugin_i.h file, otherwise I don't have that file.

tsvirtualchannels.h is part of Windows 7 SDK so at least with that include I don't have a problem.

One of the errors I am getting is this:

&CLSID_DVCSamplePlugin not recognized identifier

I tried to create ATL project with the name DVCSamplePlugin but I received the same message as above.

Any suggestions I need to do to be able to compile that source code?

Upvotes: 2

Views: 2271

Answers (2)

Jay Carlton
Jay Carlton

Reputation: 1178

It took me a couple of hours, but I got the source for the client plugin to build using VS 2012. Here were my steps.

  1. Start a new ATL Project named DVCPlugin. Select the option for a DLL.
  2. Choose support for COM+ and check the box for the Object Registrar.
  3. Add a file named GUID.cpp to the DVCPlugin project. include stdafx.h in this file.
  4. ATL gave me a class named CompReg, which had its own IDL entries and GUID. I needed to associate that GUID with the CDVCSamplePlugin class.
  5. In DVCPlugin.cpp, add the include for <tsvirtualchannels.h> to the top.
  6. Paste the rest of the sample code after the definition of DllInstall().
  7. Change the line DECLARE_REGISTRY_RESOURCEID(IDR_PLUGIN) to DECLARE_REGISTRY_RESOURCEID(IDR_DVCPLUGIN).
  8. It looks like building the solution silently runs the registry script in the DVCPlugin.rgs file. I had to change the threading model to Free, though.
  9. If mstsc.exe is 64-bit, you need a 64-bit plugin dll for the dynamic discovery to work.

Upvotes: 3

SChepurin
SChepurin

Reputation: 1854

This is just some code for testing Remote desktop connection -

There is an "echo" listener that is implemented by the Remote Desktop Connection (RDC) client, which is always present and listening for incoming connections. When you are writing the server side of a dynamic virtual channel (DVC) module, as a quick test you can open an endpoint named "ECHO". Any write to a channel that is instantiated from this endpoint will result in the receipt of the same data.

From MSDN. Such projects are usually included in some SDK. And this one seems to be part of Windows 8 SDK

Update: After a critique from Tim (see below), i've decided to add these links with MSDN information - Remote Desktop Services. TS-Teleport: Sample Instructions and Remote Desktop Services Blog. Dynamic Virtual Channels

Upvotes: 1

Related Questions