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

查看:24
本文介绍了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.

我们发现奇怪的是,通过控制面板切换到不同的区域设置,然后切换回新西兰可以解决问题.我很想知道相同的解决方法是否可以为您解决这个问题,只是为了验证我们是否看到了相同的现象.

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 类似的测试代码,试图对其进行跟踪并找到软件解决方法,但我们的 QA 人员此后找到了区域设置切换器"解决方法,他不想再次完全重新安装 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天全站免登陆