Resource Files (C++)


For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Resources are interface elements that provide information to the user. Bitmaps, icons, toolbars, and cursors are all resources. Some resources can be manipulated to perform an action such as selecting from a menu or entering data in dialog box.

See Working with Resources for more information.

File nameDirectory locationSolution Explorer locationDescription
Projname.rcProjnameSource FilesThe resource script file for the project. The resource script file contains the following, depending on the type of project, and the support selected for the project (for example, toolbars, dialog boxes, or HTML):

- Default menu definition.
- Accelerator and string tables.
- Default About dialog box.
- Other dialog boxes.
- Icon file (res\Projname.ico).
- Version information.
- Bitmaps.
- Toolbar.
- HTML files.

The resource file includes the file Afxres.rc for standard Microsoft Foundation Class resources.
Resource.hProjnameHeader FilesThe resource header file that includes definitions for the resources used by the project.
Projname.rc2Projname\resSource FilesThe script file containing additional resources used by the project. You can include the .rc2 file at the top of the project's .rc file.

An .rc2 file is useful for including resources used by several different projects. Instead of having to create the same resources several times for different projects, you can put them in an .rc2 file and include the .rc2 file into the main .rc file.
Projname.defProjnameSource FilesThe module definition file for a DLL project. For a control, it provides the name and description of the control, as well as the size of the run-time heap.
Projname.icoProjname\resResource FilesThe icon file for the project or control. This icon appears when the application is minimized. It is also used in the application's About box. By default, MFC provides the MFC icon, and ATL provides the ATL icon.
ProjnameDoc.icoProjname\resResource FilesThe icon file for an MFC project that includes support for the document/view architecture.
Toolbar.bmpProjname\resResource FilesThe bitmap file representing the application or control in a toolbar or palette. This bitmap is included in the project's resource file. The initial toolbar and status bar are constructed in the CMainFrame class.
ribbon.mfcribbon-msProjname\resResource FilesThe resource file that contains the XML code that defines the buttons, controls, and attributes in the ribbon. For more information, see Ribbon Designer (MFC).

File Types Created for Visual C++ Projects