Why do I get "undefined keyword or key name: I_IMAGENONE" compile error?
By Alexander Shargin, March 26, 2002.
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.
-
Create a new 'Hello World' application using 'WCE Smartphone 2002
Application' wizard.
-
Add a new text file to your project (File->New, Files tab, 'Text File'
item). Call it something like 'hello.rc2'.
-
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.
-
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
'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
Save both files.
-
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).
-
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.
Discuss
Discuss this QA.
Here you can write your comments and read comments of other developers.
|