/************************************************************************/
/* char*转CString* */
/************************************************************************/
int pCharTopCString(char *pchIn, CString *pstrOut)
{
int nLen;
WCHAR *ptch;
if(pchIn == NULL)
{
return 0;
}
nLen = MultiByteToWideChar(CP_ACP, 0, pchIn, -1, NULL, 0);
ptch = new WCHAR[nLen];
MultiByteToWideChar(CP_ACP, 0, pchIn, -1, ptch, nLen);
pstrOut->Format(_T("%s"), ptch);
delete [] ptch;
return nLen;
}
【框架-MFC】char*转CString*
最新推荐文章于 2020-12-10 13:03:06 发布