Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 » About appending menu Collapse All
Subject Author Date
Seung Cheol Lee Aug 16, 2007 - 10:34 PM

Dear Technical Support Team

My application was used the code of the LanguageSwitcher sample.
I was about to append menu with below code.
But the menu was not appended

===========================================================
CMenu *pMainMenu= m_wndMenuBar.GetMenu ();
CMenu *pPopupMenu = pMainMenu->GetSubMenu (0);
pPopupMenu->AppendMenu (MF_STRING, IDM_TEST, _T("Test Menu"));
===========================================================

When I tested the problem in your sample sources,
the operation of appending menu did well in your sample sourc without the LanguageSwitcher (SDI, MDI etc.).
But didn’t in the LanguageSwitcher sample source.

How to append menu ?

Suhai Gyorgy Aug 17, 2007 - 1:36 AM

LanguageSwitcher sample works differently because it uses the customization subsystem. So menus appearing on the screen are generated through the customizesite. You have to add the new commands through the methods of this customizesite, if you are planning to use the customization subsystem in your own application.

Seung Cheol Lee Aug 17, 2007 - 3:15 AM

Do you sample source through the methods of this customizesite.
I’m difficult to use the methods of this customizesite easily.

Technical Support Aug 17, 2007 - 6:15 AM

Your code invokes the CExtMenuControlBar::GetMenu() method. The returned menu object contains a persistent menu handle when your app is SDI. if your app is MDI, this menu is different depending on which MDI child frame is active or whether at least one MDI child frame is created. We would recommend not to use the CExtMenuControlBar::GetMenu() method because it is for internal Prof-UIS usage only. There is an article describes how to build popup menus dynamically at run time.

Prof-UIS resource manager supports automatic localization of toolbars and menus. You should simply set a new desired language identifier like demonstrated in the LanguageSwitcher sample application and re-load all the localized resources.