How to convert std:string to CString in unicode project

前端 未结 4 1465
盖世英雄少女心
盖世英雄少女心 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:14

    Bonus: if you use the conversion frequently you can define a macro:

    #define STDTOCSTRING(s) CString(s.c_str())
    

    so your code is more readable.

提交回复
热议问题