View Full Version : MdiAdv sample VS2008 bug

04-22-2010, 02:45 PM
In VS2008, the MdiAdv sample (under Samples\Toolkit\MFC\Docking\MenuBar) has a problem where the MDI windows do not show up in the Window menu. I think the problem is related to a recent change to GetMenu() in MFC where it is now declared as a virtual function. So, in SECMDIFrameWnd::UpdateWindowMenu() calls SECMDIFrameWnd::GetMenu() instead of CWnd::GetMenu(). This prevents WM_MDISETMENU from being called.

The current workaround is to override UpdateWindowMenu() in MainFrame.cpp with the following change:

if(AfxGetMainWnd()->GetMenu() == NULL)

CMenu *pMenu = AfxGetMainWnd()->CWnd::GetMenu();
if(pMenu == NULL)

05-06-2010, 08:40 AM
Thank you for sharing your insights with us, ttnakada!
Rogue Wave Stingray developers will review this override.