c++ 調用c#dll (2種方式,com組件和clr工程)_c++調用c#dll-CSDN博客
C++調用C#總結_clrcreateinstance-CSDN博客
VS2017使用C#編寫COM組件_registerforcominterop-CSDN博客
C#開發COM組件 - Mask1 - 博客園 (cnblogs.com)
以下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()); }