char*、string、CString、LPTSTR 的相互转化 wsprintf的正确使用

来源:互联网 发布:vmware14黑屏知乎 编辑:程序博客网 时间:2024/05/01 21:27
wstring CString2wstring(CString cstrText){wstring strText = cstrText.GetBuffer(0);}string CString2string(CString cstrText){string strText;strText = CT2CA(cstrText.GetBuffer(0));return strText;}CString string2CString(string strText){CString cstrText;cstrText = CA2CT(strText.c_str());cstrText += _T("\n");return cstrText;}


char* <==> std::string <==> CString <==> LPTSTR  LPCTSTR  LPSTR  LPCSTR  LPWSTR  LPCWSTR  |  _bstr_t

                                             
0 0