why void CView::PostNcDestroy() is called?
-
In a project, I use the CMainFrame* pMainFrame = new CMainFrame() to create a main frame. When the function CMainFrame::OnNcDestroy is called, void CView::PostNcDestroy() will be called. I donot know why CView::PostNcDestroy() will be called, in the function CFrameWnd::OnCreateClient() no new CView is created. Is there anyone know why? Thanks. :(
-
In a project, I use the CMainFrame* pMainFrame = new CMainFrame() to create a main frame. When the function CMainFrame::OnNcDestroy is called, void CView::PostNcDestroy() will be called. I donot know why CView::PostNcDestroy() will be called, in the function CFrameWnd::OnCreateClient() no new CView is created. Is there anyone know why? Thanks. :(
Use your debugger. As a first step I would put a breakpoint into CView::PostNcDestroy() and check out the callstack. There you will see who calls it and if you are lucky you can track back the reason. As a second try I would keep track of the creation of every CView and then find out which one is getting deleted.
-
In a project, I use the CMainFrame* pMainFrame = new CMainFrame() to create a main frame. When the function CMainFrame::OnNcDestroy is called, void CView::PostNcDestroy() will be called. I donot know why CView::PostNcDestroy() will be called, in the function CFrameWnd::OnCreateClient() no new CView is created. Is there anyone know why? Thanks. :(
Have you got an edit, scroll, list objects in your window? http://msdn.microsoft.com/en-us/library/ws8s10w4(v=vs.80).aspx[^]