TO saucer(思归):不行,还是CString temp= "0x" + strCOLOR.Mid(1,2);出错!
TO otuotu(呕吐呕吐):这怎么可能,编译都通不过。
先把是哪里出问题搞清楚,注意 if(!strCOLOR.IsEmpty()) 里有个!先试一下CString strCOLOR="#FF1122"; if(!strCOLOR.IsEmpty()) { CString temp= strCOLOR.Mid(1,2); int red=strtoul(temp,NULL,16); int green=strtoul(strCOLOR.Mid(3,2),NULL,16); int blue=strtoul(strCOLOR.Mid(5,2),NULL,16);}
if(!strCOLOR.IsEmpty())
里有个!先试一下CString strCOLOR="#FF1122";
if(!strCOLOR.IsEmpty())
{
CString temp= strCOLOR.Mid(1,2);
int red=strtoul(temp,NULL,16); int green=strtoul(strCOLOR.Mid(3,2),NULL,16);
int blue=strtoul(strCOLOR.Mid(5,2),NULL,16);}
还是if(strCOLOR.IsEmpty())