高手速度来 Visual Studio 2008的问题
我程序中有这段代码:
void CHellowDlg::OnBnClickedOk()
{
CString str,strCtrl;
str="你的年龄:";
UINT nID=GetCheckedRadioButton(IDC_AGE_L18,IDC_AGE_M38);
GetDlgItemText(nID,strCtrl);
str=str+strCtrl;
str=str+"\n你使用的接入方式:";
nID=GetCheckedRadioButton(IDC_CM_FTTL,IDC_CM_OTHER);
GetDlgItemText(nID,strCtrl);
str=str+strCtrl;
str=str+"\n你上网主要是:\n";
UINT nCheckIDs[4]={IDC_DO_POP,IDC_DO_READ,IDC_DO_GAME,IDC_DO_OTHER};
CButton* pBtn;
for(int i=0;i<4;i++)
{
pBtn=(CButton*)GetDlgItem(nCheckIDs[i]);
if(pBtn->GetCheck())
{
pBtn->GetWindowText(strCtrl);
str=str+strCtrl;
str=str+" ";
}
}
MessageBox(str);
OnOK();
}
但是编译的时候出现这个错误:
错误 1 error C2679: 二进制“+”: 没有找到接受“const char [9]”类型的右操作数的运算符(或没有可接受的转换) c:\users\liu\documents\visual studio 2008\projects\hellow\hellow\hellowdlg.cpp 165 Hellow
错误 2 error C2679: 二进制“+”: 没有找到接受“const char [7]”类型的右操作数的运算符(或没有可接受的转换) c:\users\liu\documents\visual studio 2008\projects\hellow\hellow\hellowdlg.cpp 170 Hellow
错误 3 error C2679: 二进制“+”: 没有找到接受“const char [3]”类型的右操作数的运算符(或没有可接受的转换) c:\users\liu\documents\visual studio 2008\projects\hellow\hellow\hellowdlg.cpp 180 Hellow
这个怎么回事啊 难道CString不能这么用吗?