Link to home
Start Free TrialLog in
Avatar of thready
thready

asked on

C++ event callback converted to c# events

Hi Experts,

I have a C++ callback interface (bunch of pure virtual functions in a class).  The c++ library is being instantiated in a c# class library now.

So naturally, I want to convert these "events" as c# events now.

My thinking is to create delegates in the wrapper library and convert them directly, firing them off to c#.

I know that on the C# side, if these events come from a different thread, I need to invokeLater.

Is there anything I could have done differently to make my life better here?  Looking for any great ideas at all...  :-)

Thanks,
Mike
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thready
thready

ASKER

I've got a bigger problem.  I'm trying to do this in my CLR class library.  I don't have the ability to add any C# classes to this implementation.  How can I fire off events in here?  Is there some other type of class that I can use in this context?  I don't even see how to do this at the moment...

Mike
Avatar of thready

ASKER

I just clicked... I export these functions as in your link above.  Sorry about that!  :-)
Awesome.
Avatar of thready

ASKER

Actually, this is for the exported DLL type of interop... I'm not sure this works for the CLR class library method...