Example of using delegates and callbacks from managed to native code needed

In C# I call a function from a native code dll and need to get a callback so I know when to continue. Currently the native code sends a message on successful completion which I can get by overriding WndProc but I think a callback from the native code would be a much better solution. Because the native code writes a file and for various reasons its not really acceptable to constantly be checking to see if the file exists so my managed code needs to know when the successful write occurs.

Can someone point me or provide me with some example code of this in action


Answer this question

Example of using delegates and callbacks from managed to native code needed