PInvokeStackImbalance exception when using IntPtr in .NET 4? (Works in .NET 3.5)
Might be a bit of noob question but it's something that's been getting me in a pickle for the past few hours (or days)... I'm calling a method from a DLL in my code in .NET Framework 4.0 [DllImport("xeneth.dll")] public static extern ErrorCode XC_GetFrame(Int32 h, FrameType type, ulong ulFlags, IntPtr buff, uint size); and then using it here: if (XC_GetFrame(myCam, XC_GetFrameType(myCam), 0, IntPtr.Zero, (uint)fs) != ErrorCode.E_NO_FRAME) However, when I run this in .NET 4.0 I get a P/INVOKE error, however... running this in 3.5 does not trigger this error. After myself and another programmer