MFC provides resource files localized for certain locales, in the
MFC\SRC\L.* and MFC\Include\L.* directories. This article describes how to
modify the project settings and resource file to use these localized MFC
: The information in this article does not apply to resources for ActiveX controls.
Steps to include the localized resources:
- On the Project menu, click Project Settings. In the Project Settings
dialog box, select the Resource property page. Remove the _AFXDLL
preprocessor definition. Click OK on the property sheet.
- Open the string table using the Resource Editor and remove all the non application-specific strings generated by AppWizard. For example, if
this application is an AppWizard-generated application, remove all the
entries for the IDs from ID_FILE_NEW to the end of the string table.
Strings for IDR_MAINFRAME, IDR_MYPROJTYPE, AFX_IDS_APP_TITLE, and
AFX_IDS_IDLEMESSAGE are application-specific, and therefore localized
strings are not provided by the MFC resource files.
- On the View menu, click Resource Includes. In the Compile-time
directives window, do the following:
- Set the primary language ID and the sub-language ID appropriately in
the LANGUAGE statement. The appropriate values can be found in the
...\vc\include\winnt.h file. Note that the values specified in the
LANGUAGE statement must be base-10. The values in Winnt.h are
Example: LANUGAGE 11, 1 // Specifies standard French
- Make sure that the code page specified in the #pragma code_page
statement is correct. For ANSI English and most European languages
the code page is 1252; for Japanese it is 932.
- Modify the existing statements that include resources used by the MFC
framework. These resources are located in the appropriate localized
..\vc\mfc\include directory. For example, change the following
to the following:
(A project will use the Afxolecl.rc and Afxolesv.rc files only if
they are OLE client and/or server applications.)
- The Indicate.rc and Prompts.rc files contain the key-state indicators
and menu-prompt strings that are displayed on the status bar by MFC.
These files are located in the ..\vc\mfc\src directory. To include
these files, #include them and explicitly specify their location.
- Click OK to close the Resource Includes dialog box.
- Build the application or DLL.
Technical Note 23 "Standard MFC Resources"
For more informationabout MFC Resources, click the following article numbers to view the articles in the Microsoft Knowledge Base:
How to localize the stock ActiveX property page with MFC resources
How to using MFC LOC DLLs
How to create localized resource DLLs for MFC application
Article ID: 198536 - Last Review: November 21, 2006 - Revision: 4.1
- Microsoft Foundation Class Library 4.2, when used with:
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++, 32-bit Learning Edition 6.0
|kbhowto kbintldev kbresource kblocalization KB198536|