C++写法
#define _csharp_bool extern “c” __declspec(dllexport) const bool_csharp_bool destroy_yolact_py(char *str)
{
todo…
}
C#
[DllImport(global_path + @”XXX.dll”), EntryPoint = “destroy_yolact_py”,CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
Extern static bool destroy_yolact_py ();
C# 宽字符参数传递
C#与c++ wchat_t对应关系 写法 c++传入 [MarshalAs(UnmanagedType,LPWStr)] string str
C# 接收参数 wchat_t * wstr.