Called by the framework to delete the document’s data without destroying the CDocument object itself. It is called just before the document is to be destroyed. 
-------------这是csdn里面对DeleteContents()的说明。
OnNewDocument创建新文挡;
。//聊天过程,收发信息
DeleteContents();//聊天结束,服务器关闭等等

解决方案 »

  1.   

    谁告诉你在OnNewDocument()后调用DeleteContents()的
    看看MSDN,DeleteContents()在什么时候调用
      

  2.   

    看了msdn:OnNewDocument部分,解释为:
    Called by the framework as part of the File New command. The default implementation of this function calls the DeleteContents member function to ensure that the document is empty and then s the new document as clean。
    我觉的我得逻辑符合, 但是感觉whale和rich_lee更合理,到底是怎样调用的,我的头大了, 请各位快快解释之????????