pinvokestackimbalance错误请教
大家帮忙看看,c++里的函数是这个
extern "C" __declspec(dllexport) void Trans(unsigned int inter,int * temp)
然后在c#里调用时声明的是这个
[DllImport("USBCom.dll", EntryPoint = "Trans", CharSet = CharSet.Auto)]
public static extern void Trans(UInt32 integrationTime,IntPtr Data);
运行的时候就会跳出个 pinvokestackimbalance 的错误。大家能帮忙看看错误在哪里吗?
------解决方案--------------------
[DllImport("USBCom.dll", EntryPoint = "Trans", CharSet = CharSet.Auto,CallingConvention=CallingConvention.Cdecl)]