CWnd::PostNcDestroy

 CWnd::PostNcDestroy


virtual void PostNcDestroy( );

参数:

在窗口被销毁以后,缺省的OnNcDestroy成员函数调用这个函数。派生类可以利用这个函数来执行自定义的清除工作,比如删除指针。

 

虚函数PostNcDestroy  在视图窗口关闭时最后调用的成员函数,它与CFrameWnd::PostNcDestroy完成相同的功能,即删除视图对象。代码如下:

  void CView::PostNcDestroy()

  {

  delete this;

  }

 

void CVoltageDlg::PostNcDestroy() 
{
       delete this;
       CMainFrame *pmainframe = (CMainFrame *)AfxGetMainWnd();
       pmainframe->pVoltageDlg = NULL;       //在类CMainFrame中将对象(VoltageDlg)的指针pVoltageDlg删除

pmainframe->CheckandTermiMulThread();
}

你可能感兴趣的:(职场,休闲,PostNcDestroy)