RAD Studio
ContentsIndex
PreviousUpNext
RC.EXE, the Microsoft SDK Resource Compiler

RC is the command-line version of the standard Microsoft SDK resource compiler. It accepts a resource script file (.RC) as input and produces a resource object file (.RES) as output.  

Both C++Builder 2009 and Delphi 2009 give you a choice of resource compilers. On the ProjectOptionsResource Compiler dialog box, you can select either of the following:

  • BRCC32.exe, the CodeGear resource compiler
  • RC.exe, the Microsoft platform SDK Resource Compiler
 

RC supports Unicode characters in resource files and file names, as well as new Vista resource types such as icons with alpha channel.  

The actual filename of the RC compiler in the RAD Studio environment is ERC.exe.

If you choose to use RC, several differences between BRCC32 and RC need to be addressed in existing .RC files, as follows:

  • To use Windows types or constants with RC, you need to explicitly #include <winresrc.h> for both C++ and Delphi.
  • RC does not handle image data inline as BRCC32 does. To use an image with RC, you need to save the image and refer to the image inline.
  • RC handles line continution differently than BRCC32. The simplest change is to combine strings with embedded newlines (\n).
  • For RC, the order of command elements requires that all command options must come first, before the name of the resource file.
  • RC does not allow trailing commas after the string in a STRINGLIST.
  • RC treats strings as C-style strings. This means that you need to do either of the following:
    • Escape a single backslash (\) in filenames by using a double backslash (\\).
    • Use a forward slash (/) in place of a single backslash (\).
  • For RC, specifying #include <dirname> does not search the current directory. To search the current directory, use #include "dirname".
  • To embed a double-quote character in a string, use two consecutive double-quote characters ("") instead of using the backslash escape character.
  • RCDATA and byte values are handled differently. For example:
    • BRCC32 treats '11 aa 22 bb' as a string of bytes.
    • For RC, you would need to specify 0xaa11 0xbb22.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!