以下, dlg 要不要delete? (delete dlg)     CDlgFlash *dlg = new CDlgFlash(this);
     dlg->Create(CDlgFlash::IDD, this);
     dlg->ShowWindow(SW_SHOW);
     dlg->UpdateWindow();
     .....
     dlg->DestroyWindow();

解决方案 »

  1.   

    如果没有在PostNcDestroy中delete this;的话应该要delete,窗口和对象是不同的概念,窗口是销毁了,但new出来的对象没delete的,如果说错了麻烦楼下纠正
      

  2.   

    你要在特定的地方delete,但是不是这里。
      

  3.   


    到底需不需要delete? 如果需要delete, 在什么地方delete?
      

  4.   

    我是菜鸟。我只知道。自己new出来的。自己就要把它delete掉。至于什么时候delete。肯定是完全不用这个变量了才delete
      

  5.   

    重载虚函数PostNcDestroy 
    Derived classes can use this function for custom cleanup such as the deletion of the this pointer.
      

  6.   

    在PostNcDestroy  中 delete this;