PRB: App Studio Does Not Evaluate RC File Constant Expression

Last reviewed: August 26, 1997
Article ID: Q101527

The information in this article applies to:
  • The App Studio included with: - Microsoft Visual C++ for Windows, versions 1.0, 1.50, 1.51, 1.52 - Microsoft Visual C++ 32-bit Edition, versions 1.0, 2.0, 2.1, 4.0, 5.0

SYMPTOMS

An attempt to use a constant integer expression to define a resource identifier in an application's resource (.RC) file fails. App Studio version 1.x displays the following message:

   Error RW2002: File not found: <resource>

Visual C++ version 2.x displays the same message if a .RC file containing a constant integer expression used to define a resource identifier is loaded into App Studio or opened in the development environment. Under these circumstances, Visual C++ versions 4.x and 5.0 display a similar, but slightly different message:

   error RC2135: file not found: <resource>

RESOLUTION

Use a text editor to modify the resource file. Place the statements that include an expression into an "#ifndef APSTUDIO_INVOKED" block. App Studio does not automatically read that portion of the resource file for editing and App Studio does not list those resources as part of the .RC file. Use a text editor to make any further changes to those lines.

MORE INFORMATION

To demonstrate this situation, place the following statements into a resource (.RC) file:

   #define MyResourceID 3
   MyResourceID+2 bitmap MyBitmap.bmp

To work around this situation, modify the resource file as follows:

   #define MyResourceID 3
   #ifndef APSTUDIO_INVOKED
   MyResourceID+2 bitmap MyBitmap.bmp
   #endif
Keywords          : AppStudioIss
Version           : WINDOWS:1.0,1.5,1.51,1.52;WINDOWS:1.0,2.0,2.1,4.0,5.0
Platform          : NT WINDOWS
Issue type        : kbprb


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 26, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.