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 )]