且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PInvokeStackImbalance C# 调用非托管 C++ 函数

更新时间:2022-12-16 09:11:02

Dane Rose 的评论,您可以在 C++ 函数上使用 __stdcall 或在您的 CallingConvention = CallingConvention.Cdecl 声明>DllImport.

As mentioned in Dane Rose's comment, you can either use __stdcall on your C++ function or declare CallingConvention = CallingConvention.Cdecl on your DllImport.