We help IT Professionals succeed at work.

How to make non Enlish menu in VC++?

pbtdanh
pbtdanh asked
on
I want to make a non_English menu (such as Vietnamese menu, Chinese menu).
Thanks for helping.
Comment
Watch Question

Aaron JabamaniTechnical Architect

Commented:
Hi,
  U have to load menu items from the string table .

-Peter
Hi,
Basically u need to have different resource DLLs which have string table for differnt languages and Load the dlls and store the handles of the dlls resource.
ex: hjanaHandle = LoadLibrary("Japan_Res");
where Japan_Res is Dll name.
When user tries  to switch to Japaneese language.
Load the japaneese resource using
AfxSetResourceHandle(hjanaHandle);
And load the strings from the string table add it to stringarray and changes the captions of the each menu item using stringarray programatically.
-Hope that helps u.
-Shilpa
Commented:
To shilpa_Jb & apeter:

>U have to load menu items from the string table

>And load the strings from the string table add it to stringarray and changes the captions of the each
menu item using stringarray programatically.

Hm, strange approach, so you means that you can have in dll let's say Chinese string table but for Chinese menus you have to create it programmaticly out of string table??? :)

To pbtdanh:

What you have to do is the same you have done with english resources. Make sure you OS supports fonts you need, I mean if you are working under Chinese resources then your VC have to be able to use Chinese letters. Make sure in the settings of the project you have Chinese for resources. Also I edited .rc file in text mode to be sure than VC doesn't messed around. And actually it's better to read some books about localization and globalization of software. It worth the time you spend. There are a lot of tips and trick you have to know, or may be not have to know but nice to know.

Also you app sould be compiled like multibyte or unicode app, depends from your needs.

Ask if you need some more details.
BRONZE EXPERT
Author of the Year 2009
Commented:
In the VC IDE Resource Editor, create a new menu.  Then in the *tree pane* right-click the memu name and choose properties.  Now you can select a language from the drop-down list.  

When your program runs on a computer in which that language is set as the default, then that menu will appear.

-- Dan

Commented:
If your VC and your OS support the fonts you want, you can create menu in languages other than english by VC IDE resource editor. Do as per Dan's suggestion(in the *tree pane* right-click the memu name and choose properties.  Now you can select a language from the drop-down list.).

To display the created menu, use following functions in sequence with appropriate arguments:
1. FindResourceEx
2. LoadResource
3. LockResource
4. LoadMenuIndirect
5. SetMenu

Hope this helps.
Namrata

BRONZE EXPERT
Author of the Year 2009

Commented:
I agree

Explore More ContentExplore courses, solutions, and other research materials related to this topic.