MFC编程中与编码方式有关的宏定义的使用
作者:互联网
1
多字节字符集:char *strcpy(char *strDestination, const char *strSource);
Unicode字符集:wchar_t *wcscpy(wchar_t *strDestination, const wchar_t *strSource);
通用:_tcscpy
#ifdef UNICODE
#define _tcscpy wcscpy
#else
#define _tcscpy strcpy
#endif
2
CString String2CString(std::string str)
{
CString cstr;
cstr = CA2T(str.c_str());//CA2T是与编码方式有关的宏定义
return cstr;
}
std::string CString2String(CString cstr)
{
std::string str;
str = CT2A((LPCTSTR)cstr);//CT2A是与编码方式有关的宏定义
return str;
}
标签:MFC,string,编程,char,str,cstr,wchar,编码方式 来源: https://www.cnblogs.com/rcg714786690/p/14830045.html