类型转换

 std::wstring ReceiveStr  = CStringW(content);
 
 CString转换为string
 
 CString sz = "abc";
string stringss(sz.GetBuffer());  toString()
std::   tmp   =   (LPSTR)(LPCTSTR)str;
std::string   tmp((LPCTSTR)str);

 

std::wstring转换为wchar_t

 CString content = L"";
 m_inputDCNum.GetWindowText(content);

 std::wstring ReceiveStr = content.GetString();//(LPCTSTR(content));

 SplitNumber( ReceiveStr.c_str(),vecDcNumber);
 
 
 
 
 std::wstring转换为CString
  CString str(test.c_str());
    AfxMessageBox(str);
/*
   

你可能感兴趣的:(类型转换)