PInvokeStackImbalance C# call to unmanaged C++ function

前端 未结 5 1815
礼貌的吻别
礼貌的吻别 2020-12-05 00:09

After switching to VS2010, the managed debug assistant is displaying an error about an unbalanced stack from a call to an unmanaged C++ function from a C# application.

<
5条回答
  •  难免孤独
    2020-12-05 00:33

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

提交回复
热议问题