Microsoft KB Archive/76714

= INFO: Only One .rc File Is Permitted Per Project =

Article ID: 76714

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual C++ 1.0 Professional Edition
 * Microsoft Visual C++ 1.5 Professional Edition
 * Microsoft Visual C++ 1.51
 * Microsoft Visual C++ 1.52 Professional Edition
 * Microsoft Visual C++ 1.0 Professional Edition
 * Microsoft Visual C++ 2.0 Professional Edition
 * Microsoft Visual C++ 2.1
 * Microsoft Visual C++ 4.0 Standard Edition
 * Microsoft Visual C++ 4.1 Subscription
 * Microsoft Visual C++ 4.2 Professional Edition
 * Microsoft Visual C++ 5.0 Standard Edition
 * Microsoft Visual C++ 6.0 Service Pack 5

-



This article was previously published under Q76714



SUMMARY
The Microsoft Visual C++ development environment supports only one resource (.rc) file in each project. An attempt to add a second resource file to a project causes the environment to display an error.

In Microsoft Visual C++ for Windows, versions 1.0 through 1.52, and Microsoft Visual Workbench, 32-bit Edition, version 1.0:

You can only add one Resource Script. Would you like to replace the current script?

This message box includes buttons labeled &quot;Yes&quot; and &quot;No.&quot;

In Microsoft Visual C++, 32-bit Editions, versions 2.x and later:

Multiple .rc files exist in the project. Only one can be marked as included in the build. The others will be excluded from the build.



MORE INFORMATION
To store resources in more than one file, create a master .rc file that uses the #include preprocessor directive to include resources from the other files. For example, consider the case in which the Rc1.rc and Rc2.rc files store resources for a project. Create a master .rc file called Proj.rc that contains the following text: #include &quot;Rc1.rc&quot; #include &quot;Rc2.rc&quot; This file instructs the resource file to compile all resources contained in the other .rc files into the application's resources while the project only contains one .rc file.

In Visual C++, versions 5.0 and 6.0, use the following steps to include other resource files into one main resource script:


 * 1) On the View menu, click Resource Includes.
 * 2) In the Resource Includes dialog box, click inside the Compile-Time Directives list.
 * 3) Type #include statements at the end of this list in the format of the previous example.

