对CString分割字符串,推荐使用其成员函数Tokenize
CString str(255,255,255);
std::vector<CString> vecRGB;
CString strToken(_T(","));
int nPos = 0;
while(1)
{
strRGBValue = str.Tokenize(strToken ,nPos);
if (-1 == nPos)
{
break;
}
vecRGB.emplace_back(strRGBValue);
}
COLORREF f = RGB(_ttoi(vecRGB[0]),_ttoi(vecRGB[1]),_ttoi(vecRGB[2]));
_ttoi把字符串转int兼容ansic 和unicode