c++ 调用c#dll (2种方式,com组件和clr工程)_c++调用c#dll-CSDN博客
C++调用C#总结_clrcreateinstance-CSDN博客
以下C#的字符串和std:string之间互转:
string Clr字符串转Cpp(System::String^ strClr) { const char* chars = (const char*)(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(strClr)).ToPointer(); string str = chars; Marshal::FreeHGlobal(IntPtr((void*)chars)); return str; } System::String^ Cpp字符串转Clr(string str) { return gcnew String(str.c_str()); }
标签:调用,string,c#,System,c++,str From: https://www.cnblogs.com/81/p/17931610.html