I\'m having trouble using _set_purecall_handler with P/Invoke in C#.
Basically, this works:
(C++)
_set_purecall_handler(MyPureCa
After trial and error, I found that referencing msvcr100d.dll (d = debug) instead of msvcr100.dll worked as I was under the debugger.
Here's my source (I don't know if this is good practice, but I've successfully tested under debug / release mode):
private const string DllName =
#if DEBUG
"msvcr100d.dll";
#else
"msvcr100.dll";
#endif
public delegate void PureCallHandler();
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern PureCallHandler _set_purecall_handler(PureCallHandler handler);