Pages

Search This Blog

Saturday, July 17, 2010

Convert CString to std::string and vice versa

// convert from std:string to CString
CString errorMsg'
std::string encodeError = "Error 01";
errorMsg = CString(encodeError.c_str());



// convert from CString to std:string
CString csData = "f1db14dfa5d54f0b";
std::string ssData((LPCTSTR)csData);

No comments: