2010-06-20 78 views

回答

1

1停止CMainFrame中)在你的CMainFrame消息映射處理程序添加到WM_CLOSE消息:

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) 
    ... 
    ON_WM_CLOSE() 
    ... 
END_MESSAGE_MAP() 

2)添加AFX_MSG無效的OnClose();在頭文件

3)添加的CMainFrame :: OnClose中的類定義()實施

void CMainFrame::OnClose() 
{ 
    if (okToClose) 
    { 
     CFrameWnd::OnClose(); 
    } 
    else 
    { 
     // Do nothing 
    } 
}