I'm trying to catch a WM_CLOSE or WM_DESTROY message for a control bar, but
something is not right.
I have a class MyClass that inherits from CDialogBar. An instance of MyClass is created in a class CMainFrame that inherits from CMDIFrameWnd. The control bar is than created using CDialogBar's Create member function. ShowControlBar()
is also called to display the bar.


My class has the following message map, with the OnClose()hook implemented.

BEGIN_MESSAGE_MAP(CMyClass, CDialogBar)
ON_WM_CLOSE()
END_MESSAGE_MAP()

Since CDialogBar inherits from CWnd, one would expet that catching the WM_CLOSE
would work.
For some reason OnClose() is never called. Help!!!