static INT_PTR StatusName(CString csTxt)
{
CString csTemp;
csTemp = csTxt;
char * pchar = new char [csTemp.GetLength()*2 + 1];
memset(pchar,csTemp.GetLength()*2+ 1);
WideCharToMultiByte( CP_ACP,csTemp,-1,pchar,csTemp.GetLength()*2 + 1,NULL,NULL );
unsigned char buf1[2];
buf1[0] = pchar[1];
buf1[1] = pchar[0];
shortiAsccii = 0;
memcpy(&brt,buf1,2);
delete [] pchar;
pchar = NULL;
return (INT_PTR)iAsccii;
}
测试环境:VC2010
原文链接:https://www.f2er.com/vb/257560.html