开发者

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

开发者 https://www.devze.com 2022-12-12 01:33 出处:网络
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.

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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号