Warning: calling DestroyWindow in CDialog::~CDialog --
 OnDestroy or PostNcDestroy in derived class will not be called.这个错误一般发生的环境是什么,如何消除呢?请指教谢谢!

解决方案 »

  1.   

    你在析构函数中调用DestroyWindow函数,已经没有意义了。
      

  2.   

    这个不是说你在CDialog::~CDialog中调用了销毁窗口的DestroyWindow函数,那么PostNcDestroy和OnDestroy将不会被调用的,也就说没有用呀。
      

  3.   

    Assume, for example, you have overridden DestroyWindow in a CView-derived class. Since MFC source code does not call DestroyWindow in any of its CFrameWnd-derived classes, your overridden DestroyWindow will not be called unless you call it explicitly.