I’m trying to avoid COM. I’m designing a mixture C# and C++ controls on a C++ exe.
One method I came up with is PInvoking my C++ exe from C#, and sending windows messages to the C# windows. However the amount of methods I call on the controls base class is too long to justify windows messages.
So, if it’s possible to export a whole C# interface to a C++ exe, that would be way easier.
I want to avoid COM because I may have to support windows 2000, and doing COM without relying on the manifest would be a deployment hassle on a software package that currently doesn’t set much in the registry.
I use C++/CLI with VS 2010 to do this. You can expose a DLL C interface that can be consumed in the usual way, the implementation would just marshal data from that interface to your C# assembly.
Related question I think Calling C# from C++, Reverse P/Invoke, Mixed Mode DLLs and C++/CLI