Langinfo.h在Visual Studio 2010 [英] Langinfo.h in Visual Studio 2010

查看:507
本文介绍了Langinfo.h在Visual Studio 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能到包括我的Visual Studio 2010中的C-项目langinfo.h。我试过了
的#include< langinfo.h> ,但似乎没有在VS 2010环境没有这样的头文件。我需要得到该区域的起始工作日,但我现在只能方式使用这个库。
所以,问题是如何解决我的问题:如何将langinfo.h,或如何得到当前语言环境出发平日

How can I include into my Visual Studio 2010 C-project langinfo.h. I've tried #include <langinfo.h>, but it seems there is no such header file in the VS 2010 environment. I need to get the starting weekday for the locale, but I now the way only using this library. So, the question is how to solve my problem: how to include langinfo.h, or how to get the current locale starting weekday.

推荐答案

我想,你应该使用GetLocaleInfoEx()函数。
例如,为了获得一个星期这些呼叫可能被用于开始的第一天:

I think, you should use GetLocaleInfoEx() function. For example, to get the starting day of a week these calls might be used:

# if defined(_WIN32_WINNT_VISTA) && WINVER >= _WIN32_WINNT_VISTA && defined(LOCALE_NAME_USER_DEFAULT)
    GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, wsDay, 4)
# else
    GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, wsDay, 4)
# endif

有关该功能的更多信息可以在的 http://msdn.microsoft.com/en-us/library/dd318103%28v=vs.85%29.aspx

这篇关于Langinfo.h在Visual Studio 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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