Using Borland's Command Line Tools
Page 11: Resource Files

Installation, First Use Multi-File Programs
Static Libraries Static Linked and Dynamic Linked
Make Files [1],  [2],  [3],  [4]  [Summary] Create and Use a DLL
Resource Files

Resources are items which are not part of an executable's code or data but are bundled into the EXE or DLL as a kind of library of items which can be optionally loaded and used.  By convention a resource source file has an extension of .RC and it is commonly called an "rc file" (with the letters pronounced individually as in "are sea file").

The header for an RC file file defines any macros it uses and has an extension of .RH  A resource compiler is used to convert the RC file into a compiled resource file, a binary file with an extension of .RES commonly called a "res file" (with the "res" pronounced as a word with the sound of the first three letters from the word "rest")

With a resource file you can add icons, dialogs, bitmaps, lists of text strings (stringlists), sound files and many other things to a program.  Each of those items has its own syntax for how it is added to a program.   A description of resource source files and the syntax of each of the types of lines in a resource file are specified at these links:

  About Resource Files
  Resource-Definition Statements

After an rc file is created it must be compiled to a res file.  The resource compiler, brcc32.exe, is used to do that.  The syntax of a command line to use it is simple, you need only give the rc file name on the command line.  If the rc file includes any system files, for example windows.h, then you do need to tell it the path to the include files.   Note that it uses a lower case 'i' and not the '-I' that the compiler uses for an include directory option.

  brcc32 myrcrile.rc
  brcc32 -ic:\borland\bcc55\include hello.rc

The linker, ilink32.exe, is used to bind a res file to an executable.   The source files are:
  // --------HELLO.RC--------
  1 ICON "tlight.ico"
  // ------------------------

  // -------HELLO.CPP--------
  #include <iostream>
  using namespace std;

  int main()
    {
    cout << "Hello World!" << endl;
    return 0;
    }
  // ------------------------
Download the icon by right clicking this image and selecting "save target as": TLight.ico

Give these commands to build the program:
bcc32 -c -WCR hello
brcc32 hello
ilink32 /Tpe/ap/Gn/x/c c0x32 hello,hello,,import32 cw32i,,hello
Afterwards start Windows Explorer (not Internet Explorer) and look at the file.  You will see the traffic light is shown as its icon.  (If you cannot find Windows Explorer, look in Start|Programs|Accessories).

 
[Next Page: none yet]

:: Main | Search | Site Map
 
:: Algorithms & Code
:: Assembly & Low Level
:: Borland/CodeGear
:: C & C++
:: CGI
:: CDROM Info
:: COM/DCOM/CORBA
:: Communications
:: Compression
:: Cryptography
:: File Formats
:: General Software
:: Games & Graphics
:: Hardware
:: HTML, Web Development
:: Linux/Unix/BSD
:: Microsoft
:: Miscellaneous
:: Neural Nets
:: New Links
:: Programming Articles
:: Programming Languages
:: Protocols
:: Sfwe Publications
:: Sfwe Sellers
:: Std Template Lib/STL
:: Tutorials, Refs: C/C++
:: Tutorials, Refs: Other
:: Utilities & Tools
:: XML & XHTML
:: Windows, Win32
:: 8051 & Embedded
  Programming Pages 
::  #1 #2 #3 #4 #5 #6 #7
Valid HTML 4.01 Strict