我用的是CEditView 每次关闭程序的时候 都提示我是否保存信息, 我该如何把这个提示信息给屏蔽掉? 我实在不想它每次关闭的时候都跳出那个提示框。 谢谢

解决方案 »

  1.   

    重载onclose
    参看mfc编程实例
      

  2.   

    这个方法不行 好象得override CDocument::SaveModified 
    return true;
      

  3.   

           处理WM_CLOSE消息      加入SetModifiedFlag(FALSE)试下.
      

  4.   

    这倒是,我记的好像和上面那位一样,有一个地方把return的参数变了就是。可惜记不清了。
      

  5.   


    virtual BOOL SaveModified( );Return ValueNonzero if it is safe to continue and close the document; 0 if the document should not be closed.ResCalled by the framework before a modified document is to be closed. The default implementation of this function displays a message box asking the user whether to save the changes to the document, if any have been made. Override this function if your program requires a different prompting procedure. This is an advanced overridable
      

  6.   

    我试过了,重载CDocument::SaveModified(),return true;就行了。如:
    BOOL CEditViewDoc::SaveModified() 
    {
    // TODO: Add your specialized code here and/or call the base class

    return true;
    }
      

  7.   

    或在SaveModified()内添加如下代码:
    SetModifiedFlag(false);
    也试过了,OK。