The file types involved with resource file usage are defined in the following diagram:

These files work together as follows:
the C++ compiler and linker, together, take .cpp
source files and produce .exe output (or .dll, or
.app, or another such extension)
the resource compiler takes a .rss source file
containing RESOURCE statements and converts it into a
.rsc resource file which contains the resources the executable
program will use. It also produces a .rsg generated header file,
which contains the symbolic ids of these resources.
the .rsg file is #included by the
.cpp file, so that the C++ compiler has access to the symbolic ids
of the resources that will be used
C++ class definitions are specified in a .h file; a
typical application will include several system header files and usually one or
more of its own
resource structs are specified in a .rh file. A
typical application will use system-provided resource headers, which define
standard controls etc. Only if the application requires its own structs, will
it include its own .rh file
flag values are #defined in a file which must be
available to both the C++ compiler and the resource compiler: the
.hrh extension is used for this and .hrh files are
typically #included into the .h file that defines the
classes (for C++) and the .rh file that defines the
structs (for the resource compiler)