PDA

View Full Version : MdiAdv sample VS2008 bug



ttnakada
04-22-2010, 03: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:

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

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

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