1:std::string转String^:
std::string stdstr="";String^ str = marshal_as<String^>(stdstr);
2:String^转std::string:
String^ str= gcnew String();
std::string stdstr = marshal_as<std::string>(str->ToString());
3:CString转Sting^:
CString cstr="";
String^ str = marshal_as<String^>(cstr.GetBuffer());
cstr.ReleaseBuffer();
4:String^转CString:
String^ str;
CString cstr(str);