我做的dialog在点右上角的 X 后关闭了,但是句柄没有释放,我想问一下,怎么用这两个类去重载实现句柄释放呢?因为这个句柄不释放的话其他窗口无法正常打开。void CDlgInfo::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
}void CDlgInfo::OnClose()
{
// TODO: Add your message handler code here and/or call default
CDialog::OnClose();
}
最好能写出代码,谢谢。我是初学
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
}void CDlgInfo::OnClose()
{
// TODO: Add your message handler code here and/or call default
CDialog::OnClose();
}
最好能写出代码,谢谢。我是初学
{
// TODO: Add your message handler code here and/or call default //::DestroyWindow(m_hWnd); // 如果是非模态对话框调用这个
::EndDialog(m_hWnd, nRetCode); // 如果是模态对话调用这个
CDialog::OnClose();
} 上面那2个语句要看你的对话框是属于模态还是非模态来选择,调用其中一个。
{
// TODO: Add your message handler code here and/or call default
delete this;
CDialog::OnClose();
}