Registering a delegate function with an ISO C++ callback (on mono)
- by Stick it to THE MAN
I am thinking of wrapping ISO C++ code in C# class.
The only problem so far is how to deal with the C++ callbacks. In .Net languages (C# and Vb.Net), I believe the callback equivalent. Sticking with C# for now, can anyone recommend a way that I can register the C# delegate functions with my ISO C++ code.
The ISO C++ code is a notification library, and I want to be able to "push" the notifications to the mono framework (i.e. C# delegates in this case).
My underlying assumption is that the mechanism/steps to implement this would be the same for the .Net languages - I'll just have to code the actual delegates in the .Net language of choice - is that assumption correct?
Last but not the least, is the question of thread saftey. The underlying ISO C++ code that I am exposing to .Net (mono to be more specific), is both re-ntrant and thread safe - do I have to do anything "extra" to call .Net delegate from my ISO C++ code?