MFC里面CString 与 string 互相转化 的问题。_基础类_VC/MFC-ITnose http://www.itnose.net/detail/6110703.html
大致是这样
CString-string:
CString str1;
m_editUsername.GetWindowTextW(str1);
char *chr1 = new char[str1.GetLength() + 1];
WideCharToMultiByte(CP_ACP, 0, str1.GetBuffer(), -1, chr1, str1.GetLength() + 1, NULL, NULL);
string tmp1 = chr1;
string-CStirng:
CString str;(注意:不能写成CString str=userID.c_str();)
str = userID.c_str();
AfxMessageBox(str);