Re: Mal wieder: Probleme mit Feature-Pack - Toolbars

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hallo Holger!

NEIN! Es steht doch dort direkt, dass in diesem Fall
OnDestroy NICHT aufgerufen wird -> also wird die globale
Liste NICHT aufgeräumt!

Warum wirst Du laut? Wo steht das? Und warum?
1. Ein CMFCToolBar ist von CWnd abgeleitet
2. Der Destruktor von CWnd ruft DestroyWindow auf wenn m_hWnd nict NULL ist (siehe MFC Source Code)
3. DestroyWndow führt zum Aufruf von OnDestroy.

CMFCToolBar kann doch nicht verhindern das der CWnd Destruktor aufgerufen wird! Ich kann Dein Problem in keiner Weise in einem Sample nachvollziehen.

--
Martin Richter [MVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming
FAQ: http://www.mpdvc.de Samples: http://www.codeproject.com
.



Relevant Pages

  • Re: Mal wieder: Probleme mit Feature-Pack - Toolbars
    ... OnDestroy NICHT aufgerufen wird -> also wird die globale ... Der Destruktor von CWnd ruft DestroyWindow auf wenn m_hWnd nict NULL ist ... CMFCToolBar kann doch nicht verhindern das der CWnd Destruktor aufgerufen wird! ...
    (microsoft.public.de.vc)
  • Re: OnDestroy vs Destructor
    ... The destructor is not called until the CWnd object is destroyed. ... DestroyWindow is called. ... that you explicitly allocate, the safest place to do this is in the PostNcDestroy handler, ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: How much oop is too much oop?
    ... >>> directly nor called indirectly on your behalf by Windows in certain ... > whenever DestroyWindow is called, ... > MFC arranges for CWnd to have a NULL HWND. ... Yes but nothing prevents you from having a CWnd * to a deleted CWnd. ...
    (microsoft.public.vc.language)
  • Re: Q: CWnd::FromHandle pointer handling
    ... If it were a permanent handle, ... I don't think that's a problem, since the CWnd dtor calls DestroyWindow if ... and the response to WM_NCDESTROY is to call Detach. ... DestroyWindow is still problematic, as described by this excerpt from ...
    (microsoft.public.vc.mfc)