4.1.3.2.4 Defining (or Re-defining) Resource IDs in the Symbol Include Header File

When you create a resource using the Origin Dialog AppWizard the resource ID strings for the dialog, tabbed dialog, wizard, tab and wizard placeholders, and tabs and wizard pages are automatically defined. Similarly, when you add a control to a resource its resource ID string is automatically defined by Visual C++. Generally, you will not need to (and we recommend that you not) manually define resource ID strings. However, there may be occasions when you have to or want to define new or re-define existing resource ID strings (see Adding Tabs or Wizard Pages After the Origin Dialog AppWizard is Closed for one such case).

To define a new or re-define an existing resource ID string follow the steps below.

  1. Open the Symbol include header file for your Visual C++ project (See the section Renaming the Symbol Include Header File to determine the name of your Symbol include header file and see the section Opening your Resource and Workspace Files to learn how to open header files in Visual C++). If you created your Visual C++ project with the Origin Dialog AppWizard and closely followed the recommended steps this file should be named <Your Project Name>Res.h where <Your Project Name> is the name of your Visual C++ project. The images below show typical Symbol include header files for a tabbed dialog and a wizard.Defining (or Re-defining) Resource IDs in the Symbol Include Header File image119.gifDefining (or Re-defining) Resource IDs in the Symbol Include Header File image118.gif
  2. To define a new resource ID string click at the end of the line on an existing #define directive and press ENTER. In the new line, type a new #define directive using the syntax
    #define IDD_STRING VALUE

    for a dialog, tabbed dialog, wizard, tab, or wizard page and using the syntax
    #define IDC_STRING VALUE
    for all other resource types. In the syntax definitions above replace STRING with a unique and descriptive string ID for the resource and replace VALUE with a unique numeric ID that is in the required range for the given resource type.
    For example, to add a resource ID string for a new wizard page in the Symbol include header file for the wizard shown above click at the end of the line for the
    #define IDD_SECONDPAGE 3001

    directive and press ENTER. Then, in the new line, type the following text:
    #define IDD_THIRDPAGE 3002
  3. To re-define an existing resource ID string simply edit the resource ID string and numeric ID in the Symbol include header file making sure that the new definition follows the correct syntax, that the string and numeric IDs are unique, and that the numeric ID falls within the required numeric ID range for the given resource type. See step 2 above for the correct syntax and a link to a table listing required numeric ID ranges.
  4. After you finish editing the Symbol include header file, click the Save button on the Standard toolbar to save your changes and then select the File:Close menu item to close the header file in the development area.
  5. Finally, if you re-define the STRING portion of an existing resource ID string already assigned to a resource in your dialog make sure you update the resource ID string in the ID combo box of your resource's Properties dialog. See Setting the Properties of Controls in your Resource for more information.