4.1.3.10 Renaming the Symbol Include Header File

Each time the Origin Dialog AppWizard and Visual C++ create a new project they name the Symbol include header file Resource.h (the Symbol include header file contains all resource IDs for your dialog, tabs, pages, and controls). To avoid confusion with other same named header files in the Code Builder Workspace (should you have more than one resource-only DLL) it is a good idea to rename the Symbol include header file. To rename the Symbol include header file follow the steps below:

• 1 Before closing, the Origin Dialog AppWizard creates a header file named <Your Project Name>Res.h (where <Your Project Name> is the name of your Visual C++ project) which contains one or more definitions of resource ID strings. This header file is intended to become the Symbol include header file for your project. Open the header file <Your Project Name>Res.h in the Visual C++ workspace.
• 2 Before saving or building your resource for the first time, search for (near the top) all lines in the <Your Project Name>Res.h header file containing the definitions of resource ID strings for main dialogs, placeholders, tabs, or wizard pages and copy them to the clipboard or to a temporary text file. The copied resource ID strings (for your simple dialog, tabbed dialog, or wizard will be pasted into the newly identified and re-created Symbol include header file (in step 5 below).
#define IDD_MYDIALOG                  100

#define IDC_PAGE_PLACEHOLDER          2000

#define IDD_FIRSTPAGE                 3000

#define IDD_SECONDPAGE                3001

#define IDD_MYDIALOG             100

#define IDC_TAB_PLACEHOLDER      1000

#define IDD_FIRSTTAB             3000

#define IDD_SECONDTAB            3001

#define IDD_MYDIALOG           100

• 3 Select the View:Resource Includes menu item (in Visual C++), clear and enter <Your Project Name>Res.h (without quotes) for Symbol header file, and then clear and enter
#include "afxres.h"

(with quotes) for Read-only symbol directives. If not empty, clear Compile-time directives. Click OK twice to close the Resource Includes and informational dialog box.

• 4 Add a control to your resource and then [Saving_and_Building_Your_Resource-only_DLL|save or build your resource]]. This will cause the newly identified Symbol include header file named <Your Project Name>Res.h to be recreated (and over-written) by Visual C++.
• 5 Re-open the re-created header file <Your Project Name>Res.h and paste the definitions of the resource ID strings (copied in step 2) near the top of the file just above the resource ID string for the control you added (in step 4).
• 6 Finally, near the bottom of the recreated <Your Project Name>Res.h file, change the line
#define _APS_NEXT_RESOURCE_VALUE 100

#define _APS_NEXT_RESOURCE_VALUE 101


The following drop-down image links show what a typical Symbol include header file for a simple dialog, a tabbed dialog, and a wizard should look like after the steps above have been completed.