开发者

Localized rc file will not compile

I have a pretty standard C++ win32 application that has been internationalized. The problem is that the translated rc files will not compile. The only differences betwe开发者_JS百科en the English rc, which does compile, and the translated rcs, which do not compile, are the LANGUAGE, code_page and the translated text. For example:

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

became

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
#ifdef _WIN32
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
#pragma code_page(932)
#endif //_WIN32

and

IDC_TOOLMENU MENU 
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "E&xit",                       IDM_EXIT
    END
    POPUP "&Help"
    BEGIN
        MENUITEM "&About ...",                  IDM_ABOUT
    END
END

became

IDC_TOOLMENU MENU 
BEGIN
    POPUP "&ファイル"
    BEGIN
        MENUITEM "閉&じる",                       IDM_EXIT
    END
    POPUP "&ヘルプ"
    BEGIN
        MENUITEM "&バージョン情報 ...",             IDM_ABOUT
    END
END

When I try to compile the Japanese rc I get the following error:

1>.\ja\Resources.rc(47) : error RC2121 : BEGIN expected in menu
1>.\ja\Resources.rc(47) : error RC2104 : undefined keyword or key name: 

Google has not been particularly helpful in this case. Any ideas?


Found the problem. My translated rc files were UTF-8 and rc.exe only supports ANSI or UTF-16LE.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜