如何在非托管 C++ 中设置文化信息?
我有一个用非托管 C++ 编写的程序,我需要从系统获取文化信息并将该信息设置为我的 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Windows 上的非托管 C++ 中,您需要的是 Locale。文化是 .NET 中定义的术语,作为该术语的替代品。
有一大堆函数,但您需要从 SetThreadLocale 开始。
SetThreadLocale 函数 (Windows) @ MSDN
内根据 MSDN 的文档,Vista 中似乎存在一些怪癖。您可能还想咨询以下功能。
SetThreadUILanguage 函数 (Windows) @ MSDN
其他感兴趣的功能可以在这里找到。
本地语言支持功能 (Windows) @ MSDN
多语言用户界面函数 (Windows) @ MSDN
编辑:
如果您正在开发一个具有基本支持的应用程序,setlocale() 可能也会感兴趣。
设置语言环境 (C/C++) @ MSDN
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