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 » CExtMenuControlBar in MDIChildWnd Collapse All
Subject Author Date
Loren Keagle May 11, 2007 - 8:03 PM

I’m having an enormous amount of difficulty adding a menu to an MDI child frame window. The child window itself needs to display the menu, not the MainFrame. The menu basically turns on/off a set of options for the contained FormView.

Adding the menu as a custom control to the view resulted in displaying all of the top-level menu items, but no popup menus would appear when I click on the buttons. I am now trying to display the menu in a DialogBar created from a dialog resource, but the menu displays vertically, docked to the top-right corner!!! I can’t find any options to change the docking that don’t crash the app.

It seems like there should be a trivial way to add a menu resource to an MDI child frame. Has someone done this?

Loren Keagle May 14, 2007 - 11:20 AM

I believe that my situation is as you described. I initialized the command manager with a unique name for this window, and this is the only Prof-UIS menubar that exists in the entire app. The menu displays perfectly fine initially, but causes the app to become unresponsive due to continuous updates from some internal timer. I’m finding that the menu gets stuck in some update loop in response to WM_TIMER messages with a timer ID of 14. I am not generating these timer messages, and Spy++ indicates that they are coming from the ControlBar itself. Is there some other initialization step that I need to take to have a simple menu in the child frame?

This is my initialization procedure in OnCreate():

VERIFY(g_CmdManager->ProfileSetup(_T("Menubar"), GetSafeHwnd()));
VERIFY(g_CmdManager->UpdateFromMenu(_T("Menubar"), IDR__VIEW_MENU));

// Set up menu object
if(!m_wndMenuBar.Create(_T("ProfUIS-ControlBar"), this, IDC_GLOBE_VIEW_MENU))
TRACE0("Failed to create menubar\n");
return -1;
ASSERT( m_wndMenuBar.GetSafeHwnd() != NULL );
//m_wndMenuBar.Create(_T("ProfUIS-ControlBar"), this);
if (!m_wndMenuBar.LoadMenuBar(IDR_VIEW_MENU))

Technical Support May 15, 2007 - 12:08 PM

We have a number of customers who implemented multiple menu bars in their projects and there were no problems. We can help you in the following way: could you send us a stripped version your project (with the UI-related code only) so we can figure out what’s wrong?

Technical Support May 14, 2007 - 8:46 AM

It is possible to instantiate multiple CExtMenuControlBar windows inside one window hierarchy, but there is a limitation in Prof-UIS: each menu bar should be the single menu bar in its command profile in the command manager. So if you have one primary menu bar in the main frame window, then all the other menu bars instantiated in the MDI child frames, views and dialogs should be created after their parent windows will setup their unique command profiles in the command manager. If you have difficulties with this issue, then you can send us a project to the support mail box at this web site so we can help you.