Including Resources Using Multiple Resource Files

Normally it is easy and convenient to work with the default arrangement of all resources in one resource script (.rc) file. However, you can add resources in other files to your current project at compile time by listing them in the compile-time directives box in the Resource Includes dialog box.

There are several reasons to place resources in a file other than the main .rc file:

If you have sections in your existing .rc files that meet any of these conditions, you should place the sections in one or more separate .rc files and include them in your project using the Resource Includes dialog box.

To include resource files that will be added to your project at compile time:

  1. Place the resources in a resource script file with a unique filename. (Do not use projectname.rc, since this is the default filename used for the main resource script file.)
  2. From the View menu, choose Resource Includes.
  3. In the Compile-time directives box, use the #include compiler directive to include the new resource file in the main resource file in the development environment. The resources in files included in this way are made a part of your executable file at compile time. They are not directly available for editing or modification when you are working on your project's main .rc file. You need to open included .rc files separately.
  4. Click OK.