How to change default language (locality) for new MFC dialogs?

Whenever I create a new dialog in Visual Studio, it sets the Language property to English (Canada) , the same as my default system. However, I have a third-party MFC library that is pretty picky and resolves a crash when I try to display such a dialog. The solution to this problem is to use English (United States) as the language. I would like my default dialogs to be English (United States) when I create them. How to do it?

+4
source share
1 answer

There is no official way to accomplish exactly what you want, the default resource language and sublanguage depend on the AFX_TARG_XXX macro, which in turn depends on the default locale of your system.

However, there is a kind of hack. Apply it at your own risk.

1) Close Visual Studio.

2) Open the resource file in Notepad.

3) Replace

 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN 

from

 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 

4) Save

This will change the language of all your existing resources.

5) Go to the folder C: \ Program Files \ Microsoft Visual Studio 10.0 \ VC \ VCWizards \ AppWiz \ MFC \ Application \ templates

6) There should be a folder named 4105. This is a folder for Canadian resources. Move it to another location. Do not delete it - when you want to return to Canadian English as a sublanguage, return it back.

7) Open your VS - now American English should be your default sublanguage for all new resources.

+5
source

Source: https://habr.com/ru/post/1401008/


All Articles