I'm assuming that you're using the Microsoft Visual Studio compiler.
When you compile a program and build an executable, sometimes you may want to add resources to the final binary program. That is, you hardcopy the images, menus, icons, and/or binary data in addition to the compiled source code which makes your program.
These 'addons' to your program are called resources.
Usually, the Microsoft Visual Studio Professional (and Premium, Ultra) have a resource editor that allow you to make resources. However, you can also build resource files from scratch if necessary, such as if you have the express edition.
The resource (.rc) file is a script which the compiler uses that tells it which binary data to hardcopy to the executable.
Typically, the format for adding resources are like so.
[resource name] [data type] [path of resource]
Of course, you specify your own resource name and type, but if you want to use resources in MS-specific functions such as
GetObject()
, then you may want to use some of the MS-specific types available (see below). The compiler may provide special headers for resource types so they ma be recognized for such functions.
The resource (.rc) file must be part of the solution in order for the compiler to use it as part of the build. Sometimes, people may use
#define
macros in the header file ( this header is included in the .cpp file and the .rc script) followed by an integer as part of the
resource name so that they may use the MAKEINTRESOURCE() macro.
You can find more information here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa380599%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ms648009%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ff468902%28v=vs.85%29.aspx