这个vc6代码:
MCASMARTMANAGER_API int __stdcall reqeustKey_test(char* prKey)
{
Xhandeler.GetPrimaryKey(prKey);
return 0;
}
prKey = "AB472EDB9012"
而这个 C# 代码:
[DllImport(McaSmartManagerDllPath, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
[return:MarshalAs(UnmanagedType.LPStr)]
public static extern string reqeustKey_test([MarshalAs(UnmanagedType.LPWStr), In, Out] string prKey);
var key_ = new string(' ', 17);
_strPrimaryKey = McaSmartNativeCommand.reqeustKey_test(key_);
我在 key_ {'い㠶㐵䘷䘰䉆ㄴ㌰'} 上收到的运行时。我究竟做错了什么?