Including Dialogs in an Application
When you save a dialog or dialogs, the editor normally creates three files:
-
The .RES (resource) file, a resource file dedicated to the Dialog Editor. This .RES file is read only by the Dialog Editor and is not the same as the .RES file that is produced by the Resource Compiler and linked into your application.
-
The .DLG (dialog) script, a text file containing DIALOG and CONTROL statements that the Resource Compiler interprets.
-
The .H (include) file, a text file containing #define statements associated with the symbolic names of controls in dialogs. (If you haven't defined any symbolic names in your dialogs, the editor won't create an .H file.)
The .DLG and .H files are used to integrate the current dialogs into your application.
By default, the editor uses the same base name for all three files. Thus, if you use the editor's suggested default name of DIALOGS, the editor writes DIALOGS.RES, DIALOGS.DLG, and DIALOGS.H.
To include dialogs in your application
-
Use #include statements to include DIALOGS.H and DIALOGS.DLG in your application's resource script (.RC) file. Place the DIALOGS.H statement before the DIALOGS.DLG statement.
#include "dialogs.h"
#include "dialogs.dlg"
-
Include DIALOGS.H in your source code.
-
Write a dialog procedure for each dialog to initialize controls and process their messages.
-
Compile your source code.
-
Use the Resource Compiler to compile the .RC file into the application's .RES file.
-
Link the .RES file into your application's .EXE file.