Search code examples
c++mfcinternationalizationresource-files

German resources loaded from resource only dll when system locale is french


In an MFC application, there are German, French, Spanish resource files. These resource files have resources to be loaded for all sub-languages.

Say for German:

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) || defined(AFX_TARG_DES) || defined(AFX_TARG_DEA) || defined(AFX_TARG_DEL) || defined(AFX_TARG_DEC)
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
#pragma code_page(1252)

Resource DLL is loaded using LoadLibrary. OS is Windows 7 Enterprise English version. In clock -> language -> region from Control Panel, it is "France". What is the reason for German resources to be loaded when MFC application is opened?


Solution

  • As we discuss in comments you can use setlocale here is the solution.