请问:这样建立与关闭非模态对话框可以吗
我在单文档中建立一个非模态对话框,
请看:
我先在视图类中定义了对话框的对象指针,
CDlgCmd *pDlg;
然后在菜单中创建它,
void CRc2View::OnCommand()
{
// TODO: Add your command handler code here
pDlg=new CDlgCmd;
pDlg->Create(IDD_DIALOG2,this);
pDlg->ShowWindow(SW_SHOW);
}
然后在对话框的Cancel消息中销毁它,
void CDlgCmd::OnCancel()
{
// TODO: Add extra cleanup here
DestroyWindow();
}
最后在视图类的析构函数中删除对话框指针,
CRc2View::~CRc2View()
{
delete pDlg;
}
[解决办法]
应该没什么问题。
[解决办法]
一般销毁时在PostNcDestroy中 delete this
[解决办法]
http://apps.hi.baidu.com/share/detail/6276413
这篇文章很详细!
[解决办法]
[解决办法]