CString lowstr ="FF";
///////////////////////////////////////////////////////////////////////////////////////////
//unicode
int L = lowstr.GetLength();
int sum(0),temp(0);
for (int i = 0; i <= L;i++)
{
swscanf_s(lowstr.Mid(i,1),_T("%x"),&temp);//swscanf_s unicode編碼
sum += temp*(pow(16,(L-1.0-i)));//pow double
}
///////////////////////////////////////////////////////////////////////////////////////////
//ANSI
char *p=(LPSTR)(LPCTSTR)lowstr;
char *str;
int lowvalue = (int)strtol(p, &str, 16);//十六進制