Hi , i have created an Delegate for a call back mechanism in C# it looks like this.
public delegate void LogProc(StructureA objAppcontext,[MarshalAs(UnmanagedType.I4)] int level,[MarshalAs(UnmanagedType.LPWStr)] string thisFile,[MarshalAs(UnmanagedType.I4)] int thisLine,
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder logMessage);
this C# delegate is passed to the C++ DLL by another method which is marshalled
static void LogProc (StructureA * context, const int level, const WCHAR * thisFile, const int thisLine, const WCHAR* logMessage)
when the call back function is called it invokes my C# method ie. LogProc, but still when it goes back to C++ DLL i am getting the following Error Message
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.ÃÂ This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
Can anybody help me out on this issue
View Complete Post