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. What can cause Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called.

What can cause Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called.

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingquestion
6 Posts 2 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.
  • C Offline
    C Offline
    cdsmith
    wrote on last edited by
    #1

    After closing my app the debugger reports this warning: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. Any ideas what can cause this? What can I be doing wrong? What should I look for to correct this? Thanks.

    R 1 Reply Last reply
    0
    • C cdsmith

      After closing my app the debugger reports this warning: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. Any ideas what can cause this? What can I be doing wrong? What should I look for to correct this? Thanks.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      You're probably deleteing a modeless CDialog without first calling its DestroyWindow(). /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

      C 1 Reply Last reply
      0
      • R Ravi Bhavnani

        You're probably deleteing a modeless CDialog without first calling its DestroyWindow(). /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

        C Offline
        C Offline
        cdsmith
        wrote on last edited by
        #3

        Ravi, Thanks for the feedback. I think these are being caused from property pages of a property sheet. Does this make sence? If so how do I correctly delete pages from a sheet? Thanks!

        R 1 Reply Last reply
        0
        • C cdsmith

          Ravi, Thanks for the feedback. I think these are being caused from property pages of a property sheet. Does this make sence? If so how do I correctly delete pages from a sheet? Thanks!

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          Is your CPropertySheet class modeless? Or, do any of your property pages display modeless dialogs? Or both? /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

          C 1 Reply Last reply
          0
          • R Ravi Bhavnani

            Is your CPropertySheet class modeless? Or, do any of your property pages display modeless dialogs? Or both? /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

            C Offline
            C Offline
            cdsmith
            wrote on last edited by
            #5

            Ravi, Thanks again for a reply. It is a complicated app. It is MDI using doc/view model. The veiw of the doc/view is split (with a splitter). One pane of the splitter is a view where I create the property sheet and the property pages. So, they are modeless as I can filp thru the pages and do work in the other panes of the split view. Craig

            R 1 Reply Last reply
            0
            • C cdsmith

              Ravi, Thanks again for a reply. It is a complicated app. It is MDI using doc/view model. The veiw of the doc/view is split (with a splitter). One pane of the splitter is a view where I create the property sheet and the property pages. So, they are modeless as I can filp thru the pages and do work in the other panes of the split view. Craig

              R Offline
              R Offline
              Ravi Bhavnani
              wrote on last edited by
              #6

              When you close the view, make sure you call the property sheet's DestroyWindow(). This should take care of the problem. When the view gets created, do:

              m_pPropSheet = new CMyPropSheet (...);
              ASSERT (m_pPropSheet != NULL);
              m_pPropSheet->AddPage (...);
              m_pPropSheet->AddPage (...);
              m_pPropSheet->AddPage (...);

              When the view gets destroyed, do:

              ASSERT (pPropSheet != NULL);
              m_pPropSheet->DestroyWindow();
              delete m_pPropSheet;

              /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

              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