I spent all day exploring this, and I'm no wiser:
I have a C # DLL, which has a PInvokes method in a C ++ DLL. I had no problems with this when compiling in Debug mode, but when compiling in Release mode, I get an AccessViolationException. Going to this problem tells me that this is probably a problem with incompatible calls. Now the C # code looks like this:
[return: MarshalAs(UnmanagedType.U1)] [DllImport("Native.dll", CallingConvention = CallingConvention.Cdecl)] internal static extern Boolean AMethod(Int32 mode, byte frame);
and in C ++:
extern "C" { DLL_EXPORT bool AMethod(int mode, BYTE frame) { ... } }
I installed a C ++ project for compilation using the __cdecl declaration convention in VS2010, but I still get an AccessViolationException, and I have no idea what else I can do. I should note that my C ++ DLL uses third-party DLLs, and I donโt know what calling convention they use.
Any help would be appreciated!
Oh, and I get no exception on my development machine, only on my target system.
PNielsen
source share