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

Switch between languages at run-time?

I’m working on a project that is supposed to work on different markets. I’m using the Unicode programming and stuff like that. As usual I have some questions!
I was able to create some tools that can help me to edit separate Unicode resource files and create extra string tables that can store international text strings. Now I want to know if is there any way I can display my user interface using a particular string table that’ll be determined at run-time based only on the locals settings on the machine where the app is running. I want to know what are the steps that must be followed to construct such an application and what are the settings that has to be done on my Visual C++ 6.0 IDE.
1 Solution
Hi Mensana !!!
     Use AfxSetResourceHandle() for localisation and AfxGetResourceHandle()
See the LANGLOAD.ZIP sample at http://www.nwlink.com/~mikeblas/samples/ .  (Note: some day, all of my samples will move to http://www.mooseboy.com/ )

..B ekiM
MensanaAuthor Commented:
Hi Mike,
Thank you for answering my question. Unlike your sample, I didn’t want to switch programmatically to a different locale within my program, but I wanted to be able to display a particular set of strings just by changing the locale for my machine. I knew that when a thread is created, it uses the system default thread locale so I’ve changed the locale before I started the app. However, I didn’t get the right behavior and it was my entire fault. In Control Panel’s Regional Settings I changed the language in “Input Locales” – last tab - instead of “Regional Settings” – first tab.
Now, that I figured this out, everything is working just fine.
Mean time other questions were raised in my head but I was able to solve them using your sample and that’s way I rate your answer as “Excellent”. Thank you again!
Eddie Lascu.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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