1. CString 转 string
unicode: // 转化为unicode.
CString sz1 = L"abc";
std::string sz2 = CT2A(sz1.GetBuffer());
非unicode: // 转化为非unicode.
CString sz1 = "abc";
std::string sz2 = sz1.GetBuffer();
MFC 转码
最新推荐文章于 2024-09-24 16:08:20 发布
1. CString 转 string
unicode: // 转化为unicode.
CString sz1 = L"abc";
std::string sz2 = CT2A(sz1.GetBuffer());
非unicode: // 转化为非unicode.
CString sz1 = "abc";
std::string sz2 = sz1.GetBuffer();