The Resource Compiler

Most Windows applications use a variety of resources, such as icons, cursors, menus, and dialog boxes. You define these resources in a file called a “resource script file,” which always has the filename extension .RC. After creating the resource script (.RC) file, the Resource Compiler compiles the .RC file and adds the compiled resources to the application's executable file. When the application runs, it can load and use the resources from the executable file.

The following is an example of a resource script file that defines two resources, a cursor and an icon:

Bullseye CURSOR BULLSEYE.CUR

Generic ICON GENERIC.ICO

The first statement defines a cursor resource by naming it (Bullseye), declaring its type (CURSOR), and specifing the file that contains the actual cursor image (BULLSEYE.CUR). The second statement does the same for an icon resource.

To compile a resource script file and add the compiled resources to an executable file, use the Build command from the Project menu. You set any options for the Resource Compiler with the Projects command on the Options menu.

For a description of how to use the Resource Compiler, or for a description of the resource statements that make up a resource script file, see the Toolkit.