pInvokeStackImbalance 調試異常的解決辦法。

code:c++

c++ dll(my-dll):c#

extern "C" __declspec (dllexport)void MyDLLFunc(char
* f, int n);

c# 調用:spa

[DllImport ( "my-dll.dll")]
public static extern  void MyDLLFunc(char * f, int n);

改正方法:code

將[DllImport] 寫成:io

[DllImport ( "my-dll.dll", CallingConvention = CallingConvention.Cdecl )]
相關文章
相關標籤/搜索