CString与std::string unicode下相互转化

长平狐 发布于 2012/08/13 15:44
阅读 2K+
收藏 0

1. CString to string

 

CString str = L"test";

CString stra(str.GetBuffer(0));

str.ReleaseBuffer();

string s(stra.GetBuffer(0));

stra.ReleaseBuffer();

 

2. string to CString

 

CString str;

string s;

str = CString(s);

str = s.c_str();


原文链接:http://blog.csdn.net/favormm/article/details/5104288
加载中
返回顶部
顶部