Changing a Symbol's Numerical Value

OverviewHow Do I

Usually you can let the development environment assign the numerical value associated with the symbol names you define. However, there may be times when you need to change the symbol value associated with a resource — for example, when you want a group of controls or a series of related strings in the string table to have sequential IDs.

For symbols already associated with a single resource, use the resource’s property page to change the symbol value. For symbols associated with more than one resource or object, make the changes directly in Resource.h using a text editor.

What do you want to do?

  • Change a symbol value assigned to a single resource

  • Change a symbol value assigned to multiple resources

To change a symbol value assigned to a single resource or object

  1. Select the resource.

  2. From the View menu, choose Properties.

  3. In the ID box, type the symbol name followed by an equal sign and an integer. For example:

     IDC_EDITNAME=5100
    

The new value is stored in the symbol header file the next time you save the project. Only the symbol name remains visible in the ID box; the equal sign and value are not displayed after they are validated.

To change the numeric value of a symbol assigned to more than one resource or object

  1. End your editing session by closing the current resource file.

  2. Open Resource.h in a source window and make the necessary changes.

  3. Save Resource.h. The next time you open the project’s .rc file, the new symbol values are used.

Note   While editing Resource.h, take special care not to define duplicate symbols. The development environment can detect duplicates only of the symbols it creates.

You can use the Resource Symbols browser to change the value of symbols not currently assigned to a resource. For more information, see Changing Unassigned Symbols.