GetThreadLocale返回与GetUserDefaultLCID不同的值? [英] GetThreadLocale returns different value than GetUserDefaultLCID?

查看:1089
本文介绍了GetThreadLocale返回与GetUserDefaultLCID不同的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要获取区域设置,例如短日期格式,我们一直使用GetLocaleFormatSettings与GetThreadLocale。直到现在,这一直没有问题。

To get the locale settings, e.g. short date format, we've always used GetLocaleFormatSettings with GetThreadLocale. This has always worked without problem until now.

我们的一些用户正在获取不同于在区域设置中配置的GetThreadLocale的不同值Windows 7.无论我们尝试什么都不能重现,但是我发送一个用户一个测试程序来获取区域设置信息,并且确定GetThreadLocale返回与GetUserDefaultLCID(2057)不同的LCID(1033)。所以不是得到英国的区域设置,而是结束了美国的区域设置。

A couple of our users are getting different values for GetThreadLocale that don't match what they've configured in the regional settings in Windows 7. We've been unable to reproduce this no matter what we try, but I sent one user a test program to get the locale information, and sure enough GetThreadLocale returns a different LCID (1033) than GetUserDefaultLCID (2057). So instead of getting UK locale settings, they end up with US locale settings.

我们是否收到不正确的区域设置?我们应该使用GetUserDefaultLCID而不是GetThreadLocale吗?

Are we getting the locale information incorrectly? Should we be using GetUserDefaultLCID instead of GetThreadLocale?

谢谢

推荐答案

你并不是唯一的一个。我在新西兰也看到了这个Windows 7,而且似乎只能让Delphi应用程序因为某些原因而脱颖而出。

You're not the only one. I've seen this too with Windows 7 here in New Zealand and it seems to only trip up Delphi applications for some reason as far as I can tell.

奇怪的事情我们发现,通过控制面板切换到不同的区域设置,然后切换回NZ解决问题。我会好奇地知道同样的解决方法是否解决了您的问题,只是为了验证我们是否看到同样的现象。

The strange thing we found is that switching to a different regional settings via Control Panel and then switching back to NZ resolves the issue. I'd be curious to know if the same workaround resolves it for you just to verify that we're seeing the same phenomenon.

我想知道如果选择非通过Windows 7安装过程的美国区域设置并不是以某种微妙的方式做正确的事情,只能由于某种原因才能执行Delphi应用程序。

I'm wondering if selecting non-US regional settings via the Windows 7 install process is not quite 'doing the right thing' in some subtle way that only trips up Delphi applications for some reason.

得到类似的测试代码到JP的尝试追踪它,并找到一个软件解决方法,但我们的质量保证员已经发现了区域设置切换的解决方法,他并没有想到完全重新安装Windows 7,以恢复原来由于某些原因,时髦的状态: - )

I'd arrived at similar test code to JP's in an attempt to track it down and find a software workaround but our QA guy had since found the 'regional settings switcheroo' workaround and he didn't fancy completely reinstalling Windows 7 again to get back to the original funky state for some reason :-)

这篇关于GetThreadLocale返回与GetUserDefaultLCID不同的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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