From a2e359613eb3f160b7b5265e5ce529f591708105 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 10 Oct 2015 22:19:59 +0200 Subject: [PATCH] Revert "Remove dynamic loading of SetThreadUILanguage." This reverts commit c5ce5bf168b1b2f6173edc8e61ed7a84e7661fbc. Using SetThreadUILanguage() directly results in compilation errors with MSVC 8, see e.g. http://buildbot.tt-solutions.com/wx/builders/wxMSW-VC8-full/builds/129/steps/libraries/logs/stdio so keep loading it dynamically for now. See https://github.com/wxWidgets/wxWidgets/pull/112 --- src/common/intl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index a4bab1bafb..fbe672550e 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -473,7 +473,12 @@ bool wxLocale::Init(int language, int flags) // behavior, so avoid calling it there. if ( wxGetWinVersion() >= wxWinVersion_Vista ) { - ::SetThreadUILanguage(LANGIDFROMLCID(lcid)); + wxLoadedDLL dllKernel32(wxS("kernel32.dll")); + typedef LANGID(WINAPI *SetThreadUILanguage_t)(LANGID); + SetThreadUILanguage_t pfnSetThreadUILanguage = NULL; + wxDL_INIT_FUNC(pfn, SetThreadUILanguage, dllKernel32); + if (pfnSetThreadUILanguage) + pfnSetThreadUILanguage(LANGIDFROMLCID(lcid)); } // and also call setlocale() to change locale used by the CRT