Changing application session locale

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have a desktop application that is similar to a survey, e.g. question and answer format. It acts like a black box for a data file that has been compiled into a unique format and is read in. Part of the data is, optionally, the language that
the user should see and type within text boxes, e.g French, German, etc. When the application is run the locale is changed for that window/session to the required language. I can also select the specific keyboard for the language if the default
one is not correct.
The app uses the c++ setlocale functions and works well for most of the languages that I need to use. However, a number of languages have a codepage value of 0 (zero) and are rejected by the function without changing the locale. If I step through
the code and bypass the test for the codepage value it correctly sets these other languages.
These are languages that exist on the machine and they can be set manually without issue.
Im hoping someone may have a workaround for this issue or at least know why MS would not allow some languages to be set programmatically.

View the full article
 
Back
Top