基础问题:不能通过对话框类的构造函数传递参数吗? 在线等。。。。
我有个对话框类,为了把参数传递过来显示,增加了个构造函数:
class CExpertInfo : public CDialog
{
public:
CString strUserName; //这些都是需要在对话框中显示的信息
CString strNickName;
CString strFace;
CString strCredit;
int extLevelUp;
int iColumnID;
CExpertInfo(CWnd* pParent = NULL); // 标准构造函数
CExpertInfo(CString UserName,CString NickName,CString Face,CString Credit,int LevelUp,int ColumnID); //我增加的构造函数
virtual ~CExpertInfo();
}
然后我在View中调用这个对话框,同时把参数传递过去:
CExpertInfo ExpertDlg("ChangHua","大侠","1.gif","100",5,1);
ExpertDlg.DoModal();
为什么一到ExpertDlg.DoModal()这里就出现断言错误呢?