Converting a .DLG to a .RC  

Using a simple text editor like NOTEPAD, open the .DLG file that you created above.  The file will look something like this:

DLGINCLUDE RCDATA FIXED IMPURE

BEGIN

"FILE.H\0"

END

 

OPTIONSLIST DIALOG 6, 18, 160, 100

STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU

CAPTION "Test Dialog"

FONT 8, "MS Sans Serif"

BEGIN

 CONTROL "Group", 101, "Button", BS_GROUPBOX, 7, 8, 144, 66

 CONTROL "&OK",  IDOK, "Button", WS_TABSTOP, 62, 79, 40, 14

 CONTROL "&Cancel", IDCANCEL, "Button", WS_TABSTOP, 111, 79, 40, 14

 CONTROL "Radio", 104, "Button", BS_AUTORADIOBUTTON, 20, 23, 39,10

 CONTROL "Radio", 105, "Button", BS_AUTORADIOBUTTON, 20, 38, 39,10

 CONTROL "Radio", 106, "Button", BS_AUTORADIOBUTTON, 20, 53, 39,10

 CONTROL "Radio", 107, "Button", BS_AUTORADIOBUTTON, 85, 23, 39,10

 CONTROL "Radio", 108, "Button", BS_AUTORADIOBUTTON, 85, 38, 39,10

 CONTROL "Radio", 109, "Button", BS_AUTORADIOBUTTON, 85, 53, 39,10

END

At the very top of the file, add the following line (adjusting the path to match your settings):

#include "C:\\POWERBAS\\WINAPI\\RESOURCE.H"

Note that non-capitalization of the keyword "#include" is important - it must be lowercase.  Additionally, backslashes in the path must be doubled to comply with C coding conventions.  Next, if the .DLG file contains the following lines near the start of the file:

DLGINCLUDE RCDATA FIXED IMPURE

BEGIN

  "FILE.H\0"

END

then replace this block with the following line (also with the "#include" keyword in lowercase):

#include "FILE.H"

Finally, use the Editor's SAVE-AS function to save the file with the file extension .RC.  For example, "MYAPP.RC".

Now we are ready to compile the new .RC file into .RES format.  However, you may first need to copy the RESOURCE.H file into the same folder as your .RC file unless you specified the path in the #include statement.

 

See Also

What is a Resource File?

Resource Editors

Resource Compiling

Resource Scripts

Converting a .RC to a .RES

Converting a .RES to a .PBR