CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    301

    Localization in Menu Bar

    Hi All,

    I am doing localization for my project so i have created a satelite dll and added all dialog control labels, menu labels and error msgs are added to the resource dll. I am able to do the dynamic label loading for everything else other than menu bar. Can i do the same for menus or not? I had a doubt as am passing the menu id to CDocMultiTemplate constructor, I will not be able to change the same after creating/opening a document. Please clarify.

    Thanks in advance
    Chitra

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: Localization in Menu Bar

    To modify the menu text at run-time you can call CMenu::ModifyMenu.
    Example:
    Code:
       CMenu* pMenu = GetMenu();
       if(NULL != pMenu)
       {
          pMenu->ModifyMenu(0, MF_BYPOSITION, -1, _T("Baba Safta"));
          pMenu->ModifyMenu(1, MF_BYPOSITION, -1, _T("Baba Surda"));
          pMenu->ModifyMenu(ID_TEST_TEST, MF_BYCOMMAND, ID_TEST_TEST, _T("Baba Novac"));
          ::DrawMenuBar(m_hWnd);
       }
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  3. #3
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Localization in Menu Bar

    Can i do the same for menus or not?
    FYI: if you use a product like Visual Localize , you don't have to worry about storing the menu strings. It can translate a standard menu resource.
    Gort...Klaatu, Barada Nikto!

  4. #4
    Join Date
    Feb 2004
    Posts
    301

    Re: Localization in Menu Bar

    Thanks for your replies!

    I am using ModifyMenu function only, I could set all the menu items with the text what ever i wanted to but the document loses it icon on its left side and the close/max/min buttons on its right side. Hope i explained properly.

    Chitra

  5. #5
    Join Date
    Feb 2004
    Posts
    301

    Re: Localization in Menu Bar

    Any suggestion from any one?

  6. #6
    Join Date
    Feb 2004
    Posts
    301

    Re: Localization in Menu Bar

    Where should i do the Modify menu code? In OnOpenDocument and OnNewdocument methods only right?
    Please calrify

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured