如果是unicode工程
USES_CONVERSION;
CString str1;
std::string str2(W2A(str1));
如果是多字节工程
CString str1;
std::string str2(str1.Getbuffer());
str1.ReleaseBuffer();
error C2065: “_lpw”: 未声明的标识
error C2065: “_lpw”: 未声明的标识符
error C2065: “_convert”: 未声明的标识符
error C2065: “_acp”: 未声明的标识符
error C2065: “_convert”: 未声明的标识符
error C2065: “_acp”: 未声明的标识符
原因:在将CString转换成char*时,用T2A,没有在前添加
USES_CONVERSION;