Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CMDIFrameWnd Menu switching Collapse All
Subject Author Date
Svetlozar Asenov Nov 6, 2006 - 11:14 AM

Hello guys, I’ve got the following problem. I have an MDI app with 2 doctemplates. When create document from the first template, the menu is fine. But when I create document from second, the menu remains the same as for the first. It seems that resources are OK, the menu and template initializations are also OK, but switching between the menus doesn’t work. It doesn’t matter what type of document is opened - it always uses the menu of the first template. If no documents, the default menu is used, like it should be. Maybe it’s something with the handling of WM_SETMDIMENU in ProfUIS? I’ve traced into the MFC and found that the call

::SendMessage(pFrame->m_hWndMDIClient, WM_MDISETMENU,
            (WPARAM)hMenuAlt, (LPARAM)pFrame->GetWindowMenuPopup(hMenuAlt));


void CMDIChildWnd::OnUpdateFrameMenu(BOOL bActivate, CWnd* pActivateWnd, HMENU hMenuAlt);

After that, i tried to trace into ProfUIS, but didn’t find anything wrong.

Regards and 10x in advance!

Technical Support Nov 7, 2006 - 11:10 AM

Could you send us the source code for the CWinApp-derived and CMDIFrameWnd-derived classes? We can guess you simply registered two CMultiDocTemplate document template objects using the same resource identifier.