To deal with situations that require native coding or when one faces the situation of needing to add native code that has no place on the core library, there is Interop. It’s a rather powerful feature that opens immense possibilities.
Sending data from the native code to the C# managed application can be done easily by using either parameters passed by reference or sending the data on the return value. But… what if you need to signal your application of random events that occurs on the native code? Well now you can!
Let me explain how easy it is to use this cool feature. 😉
On your native code, all you have to do it’s just adding a simple line of code. Really! Like this:
PostManagedEvent( EVENT_CUSTOM, 0, 1111, 2222 );
The payload that’s available consists of the last…
View original post 176 more words