Access Violation Exception/Crash from C++ callback to C# function
So I have a native 3rd party C++ code base I am working with (.lib and .hpp files) that I used to build a wrapper in C++/CLI for eventual use in C#. I've run into a particular problem when switching from Debug to Release mode, in that I get an Access Violation Exception when a callback's code returns. The code from the original hpp files for callback function format: typedef int (*CallbackFunction) (void *inst, const void *data); Code from the C++/CLI Wrapper for callback function format: (I'll explain why I declared two in a moment) public delegate int ManagedCallbackFunction (IntPtr oInst,