C++ CString and string conversion

CString to string example:

CString strMfc = "test";
std::string strStr;
strStr = strMfc.GetBuffer(0);

Example of converting string to CString:

CString strMfc;
string strStr = "test";
strMfc = strStr.c_str();

 

Guess you like

Origin blog.csdn.net/dxm809/article/details/114340269