Vic
Vic

Reputation: 2878

How to set the culture info in unmanaged C++?

I got a program written in unmanaged C++, I need to get the cultural info from the system and set that info to the current execution thread in my c++ application.

Thanks.

Upvotes: 2

Views: 4401

Answers (1)

meklarian
meklarian

Reputation: 6625

In unmanaged C++ on windows, what you need is the Locale. Culture is a term defined in .NET, as a replacement for that term.

There's a whole host of functions, but the one where you need to start is called SetThreadLocale.

SetThreadLocale Function (Windows) @ MSDN

Within the documentation at MSDN, it appears that there are quirks in Vista. You may wish to consult the following function as well.

SetThreadUILanguage Function (Windows) @ MSDN

The other functions of interest are available here.

National Language Support Functions (Windows) @ MSDN
Multilingual User Interface Functions (Windows) @ MSDN

edit:

If you are developing an application with really basic support, setlocale() may also be of interest.

setlocale (C/C++) @ MSDN

Upvotes: 5

Related Questions