Hello,
Does anyone know of any recent examples of how to create a simple COM component in C++ using Visual Studio 2008 so I can learn how to marshal different kinds of data between unmanaged and managed code, and back again. I've found a few tutorials that suggest a C++ ATL project, but project settings page no longer has the settings mentioned in the article.
What I want to do is implement a C++ DLL that would be used from C# like this:
MyComComponent myComp = new MyComComponent();
myComp.Register(new ClassWithCallbacks()) /* implements IMyCallback */
The COM component would, at timed intervals, call various methods on the provided IMyCallback instance to obtain information. Similarly, the C# code might call various methods directly, when needed.
This mechanism is to enable an application to be monitored either by (the C++ side) polling the C# side, or by the C# side reporting back to the C++ side.