Article ID: 248094
Article Last Modified on 12/11/2003
APPLIES TO
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q248094
SYMPTOMS
When compiling a resource script that includes Chinese and Japanese resources in the compile-time directives, the following errors may occur:
-or-
Where RCXXXXXX is a temporary file created by the resource compiler and YYYY is the line number.
CAUSE
The resource compiler, RC.exe, incorrectly preprocesses the resource script.
RESOLUTION
To resolve this problem, wrap the inclusion of the Japanese and Chinese scripts with the appropriate language statement.
If the resource script includes Chinese (Taiwan) resources:
#include <chinese taiwan script>.rc
wrap the inclusion as follows:
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHT) #ifdef _WIN32 LANGUAGE 4, 1 #pragma code_page(950) #endif //_WIN32 #include <chinese taiwan script>.rc #endif
If the resource script contains Chinese (PRC) resources:
#include <chinese prc script>.rc
wrap the inclusion as follows:
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) #ifdef _WIN32 LANGUAGE 4, 2 #pragma code_page(936) #endif //_WIN32 #include <chinese prc script>.rc #endif
If the resource script includes Japanese resources:
#include <japanese script>.rc
wrap the inclusion as follows:
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) #ifdef _WIN32 LANGUAGE 17, 1 #pragma code_page(932) #endif //_WIN32 #include <japanese script>.rc #endif
If the resource script includes Japanese and Chinese (PRC or Traditional):
#include <japanese script> #include <chinese script>
wrap both inclusions with the appropriate language statement.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
MORE INFORMATION
Steps to Reproduce Behavior
The following steps reproduce the RC1024 error:
- Using the MFC AppWizard (exe), create a new project.
- In the MFC AppWizard step 1, select Single document and select Japanese as the language for the resources.
- Click Finish.
- Using the MFC AppWizard (exe), create a new project and add it to the workspace that you've just created.
- In the MFC AppWizard, in step 1, select Single document and select Chinese (Taiwan) as the language for the resources.
- Click Finish.
- Set the Japanese project as the active project by using the Set active project on the Project menu.
- Select Resource Includes from the View menu.
Scroll to the end of the Compile-time Directives list box and include the Chinese resource script.
#include <chinese script>.rc
- Build the Japanese project.
The following steps reproduce the RC1022 error:
- Select Resource Includes from the View menu.
- Remove the inclusion of the Chinese resource script.
- Set the Chinese project as the active project by using Set active project on the Project menu.
- Select Resource Includes from the View menu.
Scroll to the end of the Compile-time Directives list box and include the Japanese resource script.
#include <japanese script>.rc
- Build the Chinese project.
Keywords: kbbug kbcompiler KB248094