WM_DESTROY,WM_CLOSE 功能有什么不同,为什么要设两个消息
WM_DESTROY,WM_CLOSE 功能有什么不同,为什么要设两个消息,是不是可以合并成一个?
下面程序执行时出错
void CMainFrame::OnClose()
{
// TODO: Add your message handler code here and/or call default
CMDIFrameWnd::OnClose();
CDocument *doc;
doc=this->GetActiveDocument();
}
下面程序执行时不出错,
void CMainFrame::OnDestroy()
{
CDocument *doc;
doc=this->GetActiveDocument();
CMDIFrameWnd::OnDestroy();
}
为什么呢?