For Programmers: Free Programming Magazines  


Home > Archive > VC STL > April 2005 > Changing a process' Default Language ID









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Changing a process' Default Language ID
JH Trauntvein

2005-04-14, 9:01 pm

I am writing an application that is supposed to read a language
identifier from a registry value and use the appropriate set of
translated strings based upon this identifier. I can do this with no
problem. I would further like to use that language identifier to
govern the default behaviour of the c++ run time so that regional
settings are applied. In essence, what I would like to accomplish is
that when I create a locale using std::locale("") that this preferred
language identifier will be used instead of the operating system
default. I assume here the there is some machinery that initialises
the c++ run time using OS settings before WinMain() (or main()) is
executed. I am wondering if it is possible to access this machinery
after WinMain() has begun to execute. I realise that I could set the
global locale by calling std::locale::global() but this has side
effects that I don't want to deal with (I do a lot of protocol work and
not using the classic locale tends to mess up formatting at inopportune
times. For this reason, I use the local settings where needed and use
the classic locale everywhere else).

Simon Trew

2005-04-20, 4:02 pm

What does the registry value look like? If it a string specifying a code
page, you can just pass that to std::locale instead of the empty string.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com