如果是MBCS编码: CString sss; string ss = (LPCSTR)sss; 如果是UNICODE编码: #include <atlconv.h> USES_CONVERSION; CString sss; string ss = W2CA((LPCWSTR)sss);
MFC中 怎么将CString转换为string
最新推荐文章于 2023-03-07 22:33:07 发布
如果是MBCS编码: CString sss; string ss = (LPCSTR)sss; 如果是UNICODE编码: #include <atlconv.h> USES_CONVERSION; CString sss; string ss = W2CA((LPCWSTR)sss);