This is similar to:
Calling C# code from unmanaged C++?
but the opposite. I have some managed C#/C++CLI code that has triggering events. (I don't have access to the code, just the dll). I'd like to add my own C++ functions to be triggered on the events, but can't seem to get the typing right for them to be acceptable.
The dll specification for the type is a "public void delegate" which is not even valid (unmanaged) C++ syntax. Yet the COM interface functions.
The type I need to be compatible with is (from the .tlh file):
struct __declspec(uuid("72181a6f-4cc6-39aa-89d2-c8c4fd0cab3f"))
_RecordUpdatedDelegate : IDispatch
{};
All the other solutions for 'baking' a function pointer into a C# delegate involve having some access to the C# side. I don't have that luxury. I'm thinking this is either something someone has done many times or it is impossible.