How to convert std:string to CString in unicode project

前端 未结 4 1468
盖世英雄少女心
盖世英雄少女心 2020-12-09 19:06

I have a std::string. I need to convert this std:string to a Cstring.

I try to use the .c_str() but it\'s only fo

4条回答
  •  渐次进展
    2020-12-09 19:17

    Use the ATL conversion macros. They work in every case, when you use CString. CString is either MBCS or Unicode... depends on your Compiler Settingss.

    std::string str = "string";
    CString ss(CA2T(str.c_str());
    

提交回复
热议问题