BUG: An unexpected resource language change occurs with non-English language operating systems when you use an MFC class library as a static link library in Visual C++ .NET (832187)
The information in this article applies to:
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
SYMPTOMSWhen you use a Microsoft Foundation Classes (MFC) class
library as an MFC static library instead of as an MFC shared-dynamic link library (DLL) in
an MFC program, a problem occurs with an unexpected change in the resource language. This unexpected change in the resource language occurs on a computer that has a non-English language operating system, such as
a Japanese language operating system or a Chinese language operating system. The resource language changes to English although the
language of the operating system is not English.CAUSEWhen you use an MFC static library, Microsoft Visual C++ .NET
interprets the resource language as English instead of the language of the operating system that may be the Japanese language or the Chinese language. The resource language is not
localized when the MFC class library is used in the form of an MFC static
library. This problem occurs because the directory paths in the application resource file (.rc) are missing. When you create an MFC application by using Visual C++ .NET, the directory path (l.xxx) to the afxres.rc file and to the afxprint.rc file are omitted from the resource file (.rc) file.
Note In this article, xxx is a placeholder for the language short name. If you use the Japanese language, the placeholder must contain jpn. If you use the German language, the placeholder must contain deu. If you use the Chinese language, the placeholder must contain chs.WORKAROUNDTo work around this problem, you must edit the resource file (.rc) manually. You must put the missing directory path (l. xxx) in the resource file. The directory path denotes the language of the resources that must be used in the path of the afxres.rc file and in the path of the afxprint.rc file. You must include the directory path in all the occurrences of the afxres.rc file and in all occurrences of the afxprint.rc file. For example, if you use the Japanese language, follow these steps: - Start Notepad or another text editor.
- Open the resource file (.rc) of the MFCProject project in the editor.
- Search for all the occurrences of the following string in the resource file:
afxres.rc Replace this string with the following string:l.jpn\\afxres.rc - Search for all the occurrences of the following string in the resource file:
afxprint.rc Replace this string with the following string:l.jpn\\afxprint.rc - Save the resource (.rc) file.
- Open the MFCProject project in Microsoft Visual Studio .NET.
- Press CTRL+SHIFT+B to build the solution.
Note For example, If you use the Chinese language, you must replace the afxres.rc string and the afxprint.rc string with the l.chs\\afxres.rc string and the l.chs\\afxprint.rc string, respectively. You replace these strings in the resource file. You must change the language short name in the same manner for other languages. You must build the solution again for the changes in the resource file to be effective. STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 1/5/2006 |
---|
Keywords: | kbResource kbDlg kbLocalization kbbug KB832187 kbAudDeveloper |
---|
|