CDialog的用法误区
作者:互联网
CDialog的用法
//继承CDialog实现一个自己的对话框 class CMyDialog:CDialog { public: CMyDialog(UINT uIDTemplate = IDD, CWnd* pParent = NULL); ~CMyDialog(); {IDD = IDD_MYDIALOG} MyCreate(); } CMyDialog::CMyDialog(UINT uIDTemplate, CWnd* pParent) :CDialog(uIDTemplate, pParent) { } CMyDialog::MyCreate() { Create(IDD, GetParent()); //注意这里GetParent将返回一个空的句柄,从而导致父窗口是Application的顶级窗口 } CMyDialog myDlg = new CMyDialog(IDD, pParent); myDlg->MyCreate();
标签:uIDTemplate,用法,CMyDialog,MyCreate,误区,pParent,CDialog,IDD 来源: https://www.cnblogs.com/2018shawn/p/15054340.html