Do not use the C++ delete operator to destroy a frame window. Use CWnd::DestroyWindow instead自己New的MFC基础类的对象//自己负责释放?有系统帮你释放的吗?

解决方案 »

  1.   

    光new一个还不能自动释放,CFrameWnd的autodelete是依赖于PostNcDestroy中的delete this
    必须有实际的窗口创建了(Create,LoadFrame),在窗口关闭的消息响应时调用PostNcDestroy自动删除
      

  2.   

    由CMDIFrameWnd 指定的WS_HSCROLL 和WS_VSCROLL 窗口风格应用于MDI客户窗口,而不是主框架窗口,所以用户可以滚动MDI工作区(例如在Windows 程序管理器中)。 
    MDI客户窗口与主框架窗口什么区别???
      

  3.   

    一个CAsynsCosket的基于对话框的通信 //的问题 客服端连接服务端,比如 单击一个按钮控件 触发一个函数
    函数里是
    m_sConnectSocket.Create();
    m_sConnectSocket.Connect(m_strServName,m_strServPort2);//如果连接成功,会触发系统调用重新的写的虚函数OnConnect函数把
      

  4.   

    void CFrameWnd::PostNcDestroy()
    {
    // default for frame windows is to allocate them on the heap
    //  the default post-cleanup is to 'delete this'.
    // never explicitly call 'delete' on a CFrameWnd, use DestroyWindow instead
    delete this;
    }
    PostNcDestroy里帮你做了delete操作了,所以你不需要delete了