类对象作为另一个类的成员 debug assertion failed
新建名为Check的MFC工程,基于对话框
自动生成两个类 CheckDlg.h 中CCheckDlg和Check.h 中CCheck
CCheckDlg的构造函数带参数
CCheckDlg::CCheckDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCheckDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCheckStatusDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
现在想在CCheck 类中定义一个成员CCheckDlg dlg;
编译通过,但执行时出现debug assertion failed program。。。。 file:afxwin1.inl line 22
检查错误发生在这句 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
请教如何改进