Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. why void CView::PostNcDestroy() is called?

why void CView::PostNcDestroy() is called?

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yu jian
    wrote on last edited by
    #1

    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. :(

    P E 2 Replies Last reply
    0
    • Y yu jian

      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. :(

      P Offline
      P Offline
      pasztorpisti
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • Y yu jian

        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. :(

        E Offline
        E Offline
        Erudite_Eric
        wrote on last edited by
        #3

        Have you got an edit, scroll, list objects in your window? http://msdn.microsoft.com/en-us/library/ws8s10w4(v=vs.80).aspx[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups