如何在非托管C ++中设置区域性信息? [英] How to set the culture info in unmanaged C++?

查看:103
本文介绍了如何在非托管C ++中设置区域性信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用非托管C ++编写的程序,我需要从系统中获取文化信息,并将该信息设置为c ++应用程序中的当前执行线程。



谢谢。

解决方案

在Windows上不受管理的C ++中,您需要的是语言环境。文化是.NET中定义的一个术语,是对该术语的替代。



有很多功能,但是需要启动的功能称为SetThreadLocale。



SetThreadLocale函数(Windows)@ MSDN



在MSDN的文档中,似乎在Vista中存在一些怪癖。您可能还希望参考以下功能。



SetThreadUILanguage函数(Windows)@ MSDN



此处提供了其他感兴趣的函数。 / p>

国家语言支持功能(Windows)@ MSDN

多语言用户界面功能(Windows)@ MSDN



编辑:



如果您正在开发具有真正基础支持的应用程序,则setlocale()可能也很有趣。



setlocale(C / C ++)@ MSDN


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

这篇关于如何在非托管C ++中设置区域性信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆