帮忙看看这个代码是否有错?
void CRegisterView::OnEditRegister(){
CRegisterDialog dlg;
if( dlg.DoModal() == IDOK )
{
CString str;
GetWindowText( str );
str += "/r/n";
str += "姓名:";
str += dlg.M_strName;
str += "/r/n";
str += "性别:";
str += dlg.m_nSex?"女":"男";
str += "/r/n";
str += "年龄:";
CString str1;
str1.Format( "&d", dlg.m_nAge );
str += str1;
str += "/r/n";
str += "婚否";
str += dlg.m_bMarried?"已婚":"未婚";
str += "/r/n";
str += "婚姻状况";
str += dlg.m_nWork?"在职":"下岗";
str += "/r/n";
str += "工作单位";
str += dlg.m_strUnit;
str += "/r/n";
str += "单位性质";
str += dlg.m_strKind;
str += "/r/n";
str += "工资收入";
str += dlg.m_strIncome ;
str += "/r/n";
SetWindowText( str );
}
}
这个代码编译没有问题,但是点击控件,对话框就是打不开?
麻烦高人给说说原因