RW2002 Error "Cannot Reuse String Constants" in RC.EXE

Last reviewed: November 2, 1995
Article ID: Q21569
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.0 and 3.1
  • Microsoft Win32 SDK, versions 3.1, 3.5, 3.51, and 4.0

SUMMARY

The error "Cannot Reuse String Constants" will be returned by the Resource Compiler if you have used the same ID value to define two different string constants.

For example, the following error is returned when compiling the resource file:

   Cannot Reuse String Constants

The file MY.RC may contain the following lines:

MORE INFORMATION

The following sample code can be used to demonstrate the problem.

Sample Code

   StringTable
   begin
      1, "one"
      2, "two"
      3, "three"
      1, "four"
   end

Note that "one" and "four" have the same value. This error may be less noticeable if you are using both decimal and hexadecimal notation in your RC file. In the following example, 0x010 and 16 have the same value and generate the error:

    0x010, "hex 10"
    10, "ten"
    11, "eleven"
    15, "fifteen"
    16, "sixteen"


Additional reference words: 3.00 3.10 3.50 4.00 95 RW2002 RC2151
KBCategory: kbtool
KBSubcategory: TlsRc


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: November 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.