SYMPTOMS
When compiling a resource script that includes Chinese and Japanese resources in the compile-time directives, the following errors may occur:
<path>\RCXXXXXX(YYYY) : fatal error RC1022: expected '#endif'
<path>\<file name>.rc (YYYY): error RC2104 : undefined keyword or key name
Where RC
XXXXXX is a temporary file created by the resource compiler and
YYYY is the line number.
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.