问题描述
我有一个用非托管C ++编写的程序,我需要从系统中获取文化信息,并将该信息设置为c ++应用程序中的当前执行线程。
谢谢。
在Windows上不受管理的C ++中,您需要的是语言环境。文化是.NET中定义的一个术语,是对该术语的替代。
有很多功能,但是需要启动的功能称为SetThreadLocale。
在MSDN的文档中,似乎在Vista中存在一些怪癖。您可能还希望参考以下功能。
此处提供了其他感兴趣的函数。 / p>
编辑:
如果您正在开发具有真正基础支持的应用程序,则setlocale()可能也很有趣。
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.
这篇关于如何在非托管C ++中设置区域性信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!