CColorDialog cdlg;
char *r,*g,*b;
r=new char;
g=new char;
b=new char;
CString str;
if(cdlg.DoModal()==IDOK)
{
COLORREF cSel=cdlg.GetColor();
itoa(GetRValue(cSel),r,sizeof(r));
itoa(GetGValue(cSel),g,sizeof(g));
itoa(GetBValue(cSel),b,sizeof(b));
str=(CString)r+";"+(CString)g+";"+(CString)b;
AfxMessageBox(str);
}
char *r,*g,*b;
r=new char;
g=new char;
b=new char;
CString str;
if(cdlg.DoModal()==IDOK)
{
COLORREF cSel=cdlg.GetColor();
itoa(GetRValue(cSel),r,sizeof(r));
itoa(GetGValue(cSel),g,sizeof(g));
itoa(GetBValue(cSel),b,sizeof(b));
str=(CString)r+";"+(CString)g+";"+(CString)b;
AfxMessageBox(str);
}