Trouble with DestroyWindow
-
-
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!
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? -
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!
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.
-
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!
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.