C#调用C++ dll报错,找了半天才找到缘由

错误信息以下 this

Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 'D:\MyProject\C#\CSharpInvokeCpp.CSharpDemo\CSharpInvokeCpp.CSharpDemo\bin\Debug\CSharpInvokeCpp.CSharpDemo.vshost.exe'.

Additional Information: A call to PInvoke function 'CSharpInvokeCpp.CSharpDemo!CSharpInvokeCpp.CSharpDemo.CPPDLL::Sub' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature. orm

解决方案以下: get

http://stackoverflow.com/questions/5602645/why-do-i-get-pinvokestackimbalance-was-detected-for-this-simple-example it

相关文章
相关标签/搜索