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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Trouble with DestroyWindow

Trouble with DestroyWindow

Scheduled Pinned Locked Moved C / C++ / MFC
questiondebugginghelp
4 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.
  • K Offline
    K Offline
    klm
    wrote on last edited by
    #1

    Hello, when i exit my application, i get this message from the debugger: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. What is the meaning of this Warning? Thanks for your Help!

    T S K 3 Replies Last reply
    0
    • K klm

      Hello, when i exit my application, i get this message from the debugger: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. What is the meaning of this Warning? Thanks for your Help!

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      This means that you're having problems with lifetime of your dialog. Is your dialog main window of your app? Tomasz Sowinski -- http://www.shooltz.com

      - It's for protection
      - Protection from what? Zee Germans?

      1 Reply Last reply
      0
      • K klm

        Hello, when i exit my application, i get this message from the debugger: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. What is the meaning of this Warning? Thanks for your Help!

        S Offline
        S Offline
        Scott H Settlemier
        wrote on last edited by
        #3

        That msg occurs when you have a class instance that is being destroyed before its window. The class destructor will automatically destroy the window for you, but since this is done from the destructor, the instance is no longer around to handle any messages. This is sometimes the behavior you want, just make sure that your destructor AND OnDestroy both call a cleanup routine in common.

        1 Reply Last reply
        0
        • K klm

          Hello, when i exit my application, i get this message from the debugger: Warning: calling DestroyWindow in CDialog::~CDialog -- OnDestroy or PostNcDestroy in derived class will not be called. What is the meaning of this Warning? Thanks for your Help!

          K Offline
          K Offline
          klm
          wrote on last edited by
          #4

          Hello Thomas and Scott, Thank you very much for your help! I have found the error: I have a view, he create via new dialogs. When i exit the dialogs, in my OnDestroy-function of the view, i delete the dialog. Now i delete the dialogs in the destructor of my view.

          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