构造函数声明,通过构造函数传入一个bool类型参数:
CTest(CWnd* pParent = NULL,bool isEnd1=false); // standard constructor
构造函数体:
CTest::CTest(CWnd* pParent /*=NULL*/,bool isEnd1/*=false*/)
: CDialog(CTest::IDD, pParent)
{
//{{AFX_DATA_INIT(CTest)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_isEnd1=isEnd1;
}
实例化使用:
CTest dlg(NULL,false);
dlg.DoModal();