• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Loading language based menu during run time

Hi;
I am developing and application in (vc++ MDI CFormView)
different languages. My problem is how can I load menu
in during run time depending on the user selected language.

For example I have a menu called language. It has two sub menus
called Englisch and German. When User selects German from the menu it must store German menu in both forms. If he selects English It must display German menu.

Can you please help me to do this.
0
Ashik
Asked:
Ashik
1 Solution
 
williamcampbellCommented:
Then something like this

void CMainFrame::ReplaceMenu ( UINT uMenuID )
{
   // Load the new menu.
   m_NewMenu.LoadMenu ( uMenuID  );
   ASSERT ( m_NewMenu );

   // Remove and destroy the old menu.
   SetMenu ( NULL );
   ::DestroyMenu ( m_hMenuDefault );

   // Add the new menu
   SetMenu ( &m_NewMenu );

   // Assign default menu
   m_hMenuDefault = m_NewMenu.GetSafeHmenu();  
}

 ReplaceMenu ( IDR_GERMAN );
0
 
keitha1Commented:
You could even make it automatic my setting the menu id to the CodePage number on the machine. I.E. 1033 for english.

0
 
moduloCommented:
PAQed - no points refunded (of 25)

modulo
Community Support Moderator
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now