16,471
社区成员
发帖
与我相关
我的任务
分享
CString strText(_T("xxx"));
char* pBuf = NULL;
#ifdef _UNICODE
int nLen = WideCharToMultiByte(CP_ACP, ...);
pBuf = new char[nLen];
memset(pBuf, 0, nLen);
WideCharToMultiByte(CP_ACP, ...);
#else
pBuf = new char[strText.GetLength() + 1];
strcpy(pBuf, (LPCTSTR)strText);
#endif
...
delete[] pBuf;
pBuf = NULL;