UpdateData(true);
CString str;
switch(m_Student)
{
case 0:
str= "张三:";
if(m_Lesson1)
str=str+"数学 ";
if(m_Lesson2)
str=str+"哲学 ";
if(m_Lesson3)
str=str+"医学 ";
break;
错误地方:str=str+"数学 ";
错误原因:Error 9 error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const CString' (or there is no acceptable conversion) d:\vc++\vs2005\buttonlist\buttonlist\buttonlistdlg.cpp 238
CString str;
switch(m_Student)
{
case 0:
str= "张三:";
if(m_Lesson1)
str=str+"数学 ";
if(m_Lesson2)
str=str+"哲学 ";
if(m_Lesson3)
str=str+"医学 ";
break;
错误地方:str=str+"数学 ";
错误原因:Error 9 error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const CString' (or there is no acceptable conversion) d:\vc++\vs2005\buttonlist\buttonlist\buttonlistdlg.cpp 238
改为
str +=
看看