Event handling - unmanaged C++ COM and VB .NET interop

rpins

New member
Joined
Jan 13, 2004
Messages
1
Im having all kinds of fun trying to iron out this problem, and im SURE theres an easy solution out there...

I need to use COM interop between unmanaged C++ and VB .NET to have my C++ client catch and respond to events raised in VB .NET. More specifically, Ive got a VB .NET custom user ActiveX control with a valid COM interface that Ive imported and used in my C++ client. I can make function calls from the COM client to the .NET server, but I cannot seem to handle events from the control.

Im certainly no expert on COM interop, but Ive browsed around and read bits of literature here and there on how to do this to no avail. The control doesnt seem to have any connection points to which I can connect to (which might be the problem), but trying to use ATL SINK_ENTRY with IDispEventImpl hasnt worked, nor has an MFC DECLARE_EVENTSINK_MAP with ON_EVENTs. Im at a total loss and any help would be greatly appreciated.

P.S. if none of this works, would it be feasible to pass VB a C++ function pointer via its COM interface and then have VB "call" the C++ function using this pointer? Theyre in the same address space so it should work, but can VB call a function given only an address as a long?
 
Back
Top