Resource Compiler Errors RW1004 through RW4004
The following topics cover Resource Compiler Errors RW1004 through RW4004:
Resource Compiler Fatal Error RW1004
Unexpected end of file
This error can be caused by omitting the linefeed and carriage-return characters on the last
line of a text file.
Resource Compiler Fatal Error RW1009
Error creating resource-name
Could not create specified .RES file. Make sure it is not being created on a read-only drive. Use
the /V option to find out whether the file is being created.
Resource Compiler Fatal Error RW1016
RC terminating after preprocessor errors
The Resource Compiler halted due to other errors. Fix the other errors and recompile.
Resource Compiler Fatal Error RW1021
I/O error reading file
The Resource Compiler was not able to read a file. Check that the drive containing the file is
available and that the file is valid.
Resource Compiler Fatal Error RW1022
I/O error writing file
The Resource Compiler could not write to a file.
This error may be caused by insufficient disk space. You must have free space equivalent to about
twice the size of the executable file you are creating.
Other possible reasons for this error are:
- Writing to a read-only volume
- Writing to a bad sector
- A sharing violation
Resource Compiler Fatal Error RW1023
I/O error writing file, drive full
The Resource Compiler could not write a file to a drive because the drive was full.
You must have free space equivalent to about twice the size of the executable file you
are creating.
Resource Compiler Fatal Error RW1025
Out of far heap memory
There wasn't enough memory. Consider using the Control Panel, System icon, Performance tab
to increase your system's virtual memory, reboot, and retry.
Resource Compiler Fatal Error RW1030
Output Error
The output error can be caused by any of following conditions:
- Errors occurred when linking file
LINK failed. See Set Linker Options and Linker Reference for more information about linking an
executable.
- .EXE file too large; relink with higher /ALIGN value
If the .EXE file is larger than 800K, you should use the /ALIGN:32 value on your LINK line.
- File not created by LINK
You must create the .EXE file with a version of Microsoft LINK later than 5.0 or with LINKW.
- Invalid .EXE file
Make sure that the linker created the .EXE file correctly and that the file exists. You can
check the .EXE file with the DUMPBIN utility.
- Not a Microsoft Windows format .EXE file
Make sure that the linker created the .EXE file correctly and that the file exists. You can
check the .EXE file with the DUMPBIN utility.
- Unable to create destination
RC was not able to create the destination file. Make sure that there is enough disk space
and that you have write permission on the volume.
- Unable to open exe-file
RC could not open this .EXE file. Make sure that the linker created it correctly and that
the file exists.
Resource Compiler Error RW2001
Invalid directive in preprocessed RC file
The RC file contains a #pragma directive. Use the #ifndef preprocessor directive with the RC_INVOKED
constant that the Resource Compiler defines when it processes an include file. Place the #pragma
directive inside a block of code that is not processed when the RC_INVOKED constant is defined.
Code in the block is processed only by the C/C++ compiler and not by the Resource Compiler. The
following sample code demonstrates this technique:
#ifndef RC_INVOKED
#pragma pack(2) // C/C++ only, ignored by Resource Compiler
#endif
The #pragma preprocessor directive has no meaning in an .RC file. The #include preprocessor
directive is used frequently in an .RC file to include a header file (either a project-based
custom header file or a standard header file provided by Microsoft with one of its products).
Some of these include files contain the #pragma directive. Because a header file can include one
or more other header files, the file that contains the offending #pragma directive may not be
immediately obvious. The #ifndef RC_INVOKED technique can control including header files in
project-based header files.
Resource Compiler Error RW2002
Parsing error
The parsing error can be caused by any of following conditions:
- Accelerator type required (ASCII or VIRTKEY)
The type field in the ACCELERATORS statement must contain either the ASCII or VIRTKEY value.
- BEGIN expected in accelerator table
The BEGIN keyword must immediately follow the ACCELERATORS keyword.
- BEGIN expected in dialog
The BEGIN keyword must immediately follow the DIALOG keyword.
- BEGIN expected in menu
The BEGIN keyword must immediately follow the MENU keyword.
- BEGIN expected in RCData
The BEGIN keyword must immediately follow the RCDATA keyword.
- BEGIN keyword expected in string table
The BEGIN keyword must immediately follow the STRINGTABLE keyword.
- Cannot re-use string constants
You are using the same value twice in a STRINGTABLE statement. Make sure you are not mixing
overlapping decimal and hexadecimal values. Each ID in a STRINGTABLE must be unique. For maximum
efficiency use contiguous constants that start on a multiple of 16.
- Control character out of range [^A - ^Z]
A control character in the ACCELERATORS statement is invalid. The character following the caret (^)
must be between A and Z, inclusive.
- Empty menus not allowed
An END keyword appears before any menu items are defined in the MENU statement. Empty menus are not
permitted by the Resource Compiler. Make sure you do not have any open quotation marks within the
MENU statement.
- END expected in dialog
The END keyword must occur at the end of a DIALOG statement. Make sure there are no open quotes
left from the preceding statement.
- END expected in menu
The END keyword must come at the end of a MENU statement. Make sure you do not have any open
quotation marks or a mismatched pair of BEGIN and END statements.
- Expected comma in accelerator Table
RC requires a comma between the event and idvalue fields in the ACCELERATORS statement.
- Expected control class name
The class field of a CONTROL statement in the DIALOG statement must be one of the following types:
BUTTON, COMBOBOX, EDIT, LISTBOX, SCROLLBAR, STATIC, or user-defined. Make sure the class is spelled
correctly.
- Expected font face name
The typeface field of the FONT option in the DIALOG statement must be an ASCII character string
enclosed in double quotation marks. This field specifies the name of a font.
- Expected ID value for menuitem
The MENU statement must contain a menuID field, which specifies the name or number that identifies
the menu resource.
- Expected menu string
Each MENUITEM and POPUP statement must contain a text field, which is a string enclosed in double
quotation marks that specifies the name of the menu item or pop-up menu. A MENUITEM SEPARATOR
statement requires no quoted string.
- Expected numeric command value
RC was expecting a numeric idvalue field in the ACCELERATORS statement. Make sure that you have
used a #define constant to specify the value and that the constant is spelled correctly.
- Expected numeric constant in string table
A numeric constant, defined in a #define statement, must immediately follow the BEGIN keyword
in a STRINGTABLE statement.
- Expected numeric point size
The pointsize field of the FONT option in the DIALOG statement must be an integer point size value.
- Expected numerical dialog constant
A DIALOG statement requires integer values for the x, y, width, and height fields. Make sure
that these values are included after the DIALOG keyword and that they are not negative.
- Expected string in STRINGTABLE
A string is expected after each stringid value in a STRINGTABLE statement.
- Expected string or constant accelerator command
RC was not able to determine what kind of key is being set up for the accelerator. The event field
in the ACCELERATORS statement might be invalid.
- Expecting number for ID
Expecting a number for the id field of a control statement in the DIALOG statement. Make sure you
have a number or #define statement for the control ID.
- Expecting quoted string in dialog class
The class field of the CLASS option in the DIALOG statement must be an integer or a string,
enclosed in double quotation marks.
- Expecting quoted string in dialog title
The captiontext field of the CAPTION option in the DIALOG statement must be an ASCII character
string enclosed in double quotation marks.
- File not found: filename
The file specified in the RC command line was not found. Check to see whether the file has been
moved to another directory and whether the filename or path is typed correctly. Files are searched
for using the INCLUDE environment variable or the Visual Workbench setting, if available.
- Font names must be ordinals
The pointsize field in the FONT statement must be an integer, not a string.
- Invalid accelerator
An event field in the ACCELERATORS statement was not recognized or was more than two characters
in length.
- Invalid accelerator type (ASCII or VIRTKEY)
The type field in the ACCELERATORS statement must contain either the ASCII or VIRTKEY value.
- Invalid control character
A control character in the ACCELERATORS statement is invalid. A valid control character consists of
one letter (only) following a caret (^).
- Invalid control type
Each control statement in a DIALOG statement must be one of the following: CHECKBOX, COMBOBOX,
CONTROL, CTEXT, DEFPUSHBUTTON, EDITTEXT, GROUPBOX, ICON, LISTBOX, LTEXT, PUSHBUTTON, RADIOBUTTON,
RTEXT, SCROLLBAR. Make sure these control statements are spelled correctly.
- Invalid type
The resource type was not among the types defined in the WINDOWS.H file.
- Text string or ordinal expected in control
The text field of a CONTROL statement in the DIALOG statement must be either a text string or an
ordinal reference to the type of control is expected. If using an ordinal, make sure that you have
a #define statement for the control.
- Mismatched parentheses
Make sure you have closed every open parenthesis in the DIALOG statement.
- Unexpected value in RCData
The raw-data values in the RCDATA statement must be integers or strings, each separated by a comma.
Make sure you did not leave out a comma or leave out a quotation mark around a string.
- Unknown menu subtype
The item-definition field of the MENU statement can contain only MENUITEM and POPUP statements.
Resource Compiler Error RW2003
Generation Error
General errors can be caused by any of following conditions:
- Error: Bitmap file resource-file is not in 3.00 format
Bitmaps using the Windows version 2.x format cannot be used in version 3.x resource files. The
bitmap must be redrawn or converted to 3.x format.
- Error: Old DIB in resource-name.
A Device Independent Bitmap (DIB) in the specified resource is not compatible with the 3.0 format.
The bitmap must be redrawn or converted to the 3.x format.
- Error: Resource file resouce-name is not in 3.00 format
An icon or cursor in the specified resource used a previous format. The
icon or cursor must be redrawn or converted to the 3.x format.
- Unknown DIB header format
The bitmap header is not a BITMAPCOREHEADER or BITMAPINFOHEADER structure.
- Bitmap file resource file is not in 2.03 format
A bitmap used a format earlier than version 2.03. The bitmap must be converted or redrawn using
the format for version 3.00 or later.
- Resource file is not in 3.00 format
A cursor or icon used a format earlier than version 3.00. The resource must be converted or redrawn
using the format for version 3.00 or later.
- Unable to open temporary file
The Resource Compiler was unable to open a temporary file. The probable cause is either
that you do not have write permissions for the directory or that the directory does not exist. The
Resource Compiler attempts to use these files in the directory specified by the TMP
environment variable or the current directory if none is specified.
Resource Compiler Warning RW4001
.EXE processing options (/L /M /P /T /K /E /31 or /30)
.EXE processing options (/L /M /P /T /K /E /31 or /30) were specified when no executable file would
be processed. These options can only be used when the result is an .EXE file (not a .RES file).
Resource Compiler Warning RW4003
SHIFT or CONTROL used without VIRTKEY
In an accelerator table resource, SHIFT or CONTROL require VIRTKEY. Because SHIFT and CONTROL are
indicated as flag bits in a VIRTKEY type accelerator, they cannot exist independent
from a VIRTKEY.
Resource Compiler Warning RW4004
ASCII character not equivalent to virtual key code
A string literal was used for the virtual key code in a VIRTKEY type accelerator.
This warning lets you continue, but be aware that the accelerator keys generated may not match the
string you indicated. (VIRTKEYs use different key codes than ASCII accelerators.)
Return to Main Resource Compiler Messages Page