解决eVC环境下error RC2104: undefined keyword or key name: I_IMAGENONE的错误
2009-11-28 17:20
549 查看
Question
I have created a simple 'Hello, world' application for smart phone. It compiles and runs just fine.But when I try to open rc-file in resource editor I get the following error:error RC2104: undefined keyword or key name: I_IMAGENONE.How can I fix this?
Answer
This is a known bug confirmed by Microsoft. An .rc file with menubar resources cannot be currently loaded as resource file in eVC. This will be fixed in future versions of Smartphone SDK. Meanwhile Microsoft recommends to manually edit rc-file in text editor ( see Readme.htm file for Smartphone SDK). It's not a satisfying approach, however, since editing application resources manually is a much more difficult and time-consuming operation than editing them in eVC resurce editor.A better approach is to place manubar resource in a separate text file,which will be included in the main rc-file during resource compilation (but not when rc-file is opened in eVC resource editor).
Step by step example.
1. Create a new ' Hello World ' application using ' WCE Smartphone 2002 Application ' wizard.
2. Add a new text file to your project (File->New, Files tab, 'Text File' item). Call it something like ' hello.rc2 '.
3. Try to open its rc-file in the resource editor. You will get RC2104 error.Press ' Edit code ' button to open the rc-file in the text editor.
4. Cut menubar resource from rc-file and paste it to rc2-file. After that rc-file will look like this:
//Microsoft Developer Studio generated resource script. // #include "resource.h" //////////////////////////////////////////////////////////////////////////// // // Menu // STRINGTABLE DISCARDABLE BEGIN IDS_HELLO_OK "OK" END
.codearea{ color:black; background-color:white; line-height:18px; border:1px solid #4f81bd; margin:0; width:auto !important; width:100%; overflow:auto; text-align:left; font-size:12px; font-family: "Courier New","Consolas","Fixedsys","BitStream Vera Sans Mono", courier,monospace,serif}
.codearea pre{ color:black; line-height:18px; padding:0 0 0 12px !important; margin:0em; background-color:#fff !important}
.linewrap pre{white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; word-wrap:break-word; word-break:normal}
.codearea pre.alt{ background-color:#f7f7ff !important}
.codearea .lnum{color:#4f81bd;line-height:18px}
'hello.rc2' file will look like this:
IDR_HELLO_MENUBAR RCDATA BEGIN 0, 1, I_IMAGENONE, IDOK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_HELLO_OK, 0, NOMENU, END
.codearea{ color:black; background-color:white; line-height:18px; border:1px solid #4f81bd; margin:0; width:auto !important; width:100%; overflow:auto; text-align:left; font-size:12px; font-family: "Courier New","Consolas","Fixedsys","BitStream Vera Sans Mono", courier,monospace,serif}
.codearea pre{ color:black; line-height:18px; padding:0 0 0 12px !important; margin:0em; background-color:#fff !important}
.linewrap pre{white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; word-wrap:break-word; word-break:normal}
.codearea pre.alt{ background-color:#f7f7ff !important}
.codearea .lnum{color:#4f81bd;line-height:18px}
Save both files.
5. Open View->Resource Includes dialog. Add #include "hello.rc2" directive to compile-time directive list. This way you tell eVC to include ' hello.rc2 ' file in the main rc-file during resources compilation (but not when its edited in resource editor).
6. Open rc-file in the resource editor again. You will succeed now. Note that the menubar resource will not be visible.You will have to modify it manually in hello.rc2 file (if necessary). Other resources will be available for editing.
相关文章推荐
- VS工程升级后错误error RC2104 undefined keyword or key name解决方法
- error RC2104 : undefined keyword or key name: AFX_IDS_INVALID_ARG_EXCEPTIO
- error RC2104:undefined keyword or key name
- error RC2104:undefined keyword or keyname:SS_REALSIZECONTROL 错误解决
- error RC2104:undefined keyword or key name 问题
- Visual C++ 2010项目在Visual Studio 2013中打开.rc文件提示"undefined keyword or key name: SS_REALSIZECONTROL"解决方法
- error RC2104 : undefined keyword or key name: Select 1394
- error RC2104:undefine keyword or key name:Select
- undefined keyword or key name: AFX_IDS_INVALID_ARG_EXCEPTION
- 关于error RC2104:undefined keword or key name
- 错误:java.security.InvalidKeyException: Illegal key size or default parameters解决方法
- git错误--ssh: Could not resolve hostname ssh.github.com: Name or service not known--解决方式
- 错误:java.security.InvalidKeyException: Illegal key size or default parameters解决方法
- Ionic/Angular TypeScript 错误:Object prototype may only be an Object or null: undefined的解决办法
- yum 更新163 源后出现 GPG key retrieval failed: No such file or directory的错误解决办法
- 解决The type or namespace name \'XXXX\' does not exist in the namespace \'XXXXXXXXX\' 的错误
- [EntLib]解决The type or namespace name 'Data' does not exist in the namespace 'Microsoft.Practices.EnterpriseLibrary' 的错误
- Undefined function or method ' ' for input arguments of type 'double' ---错误解决办法
- 解决hadoop启动时的dfs.namenode.servicerpc-address or dfs.namenode.rpc-address is not configured.错误
- 错误:java.security.InvalidKeyException: Illegal key size or default parameters解决方法