[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

Chapter 7.

 

Creating Win32 Resources



This chapter tells you how to define Win32 resources and incorporate them into your projects.


TIP

Note that you may also use the CodeWarrior® Resource Editor to create and manipulate resources visually. It's in the Thrill Seeker's portion of the CodeWarrior CD.


Topics in this chapter are:


Including Resource Files in a Project

There are two kinds of resource files that you can include in a Win32 project:

In either case, you can have no more than one resource file in a project. You must either combine all your resource descriptions into one resource script to be passed to the resource compiler, or precompile them all into a single resource file and include that in your project.


Win32 Resource Compiler

The Win32 resource compiler (RC) is a plug-in tool for the CodeWarrior integrated development environment. It reads standard Win32 resource scripts and compiles them into resources that are then linked into your project's object file.

The CodeWarrior resource compiler accepts resource scripts in the same format as those used by the Microsoft® resource compiler. Their syntax is fully documented in the Microsoft Win32 Reference, and in the Win32 SDK online help. See in particular the following topics:

 

ACCELERATORS Resource  
ICON Resource  
AUTOCHECKBOX Control  
LANGUAGE Statement  
AUTORADIOBUTTON Control  
LISTBOX Control  
AUTO3STATE Control  
The Listbox Control Class  
BITMAP Resource  
LTEXT Control  
The Button Control Class  
MENU Resource  
CAPTION Statement  
MENU Statement  
CHARACTERISTICS Statement  
MENUEX Resource  
CHECKBOX Control  
MENUITEM Statement  
CLASS Statement  
MESSAGETABLE Resource  
COMBOBOX Control  
POPUP Resource  
The Combobox Control Class  
PUSHBOX Control  
CONTROL: General Control  
PUSHBUTTON Control  
CTEXT Control  
RADIOBUTTON Control  
CURSOR Resource  
RCDATA Resource  
DEFPUSHBUTTON Control  
RTEXT Control  
DIALOG Resource  
SCROLLBAR Control  
DIALOGEX Resource  
The Scrollbar Control Class  
The Edit Control Class  
STATE3 Control  
EDITTEXT Control  
The Static Control Class  
EXSTYLE Statement  
STRINGTABLE Resource  
FONT Resource  
STYLE Statement  
FONT Statement  
User-Defined Resource  
GROUPBOX Control  
VERSION Statement  
ICON Control  
VERSIONINFO Resource  

Resource scripts for the CodeWarrior resource compiler are fully compatible with those accepted by the Microsoft resource compiler, with the following exceptions:

The CodeWarrior resource compiler handles doubled double quotation marks in the same way as the C compiler, rather than like the Microsoft resource compiler. For example, the Microsoft resource compiler compiles the string
   ""Hi Mom"

to


   "'Hi Mom'

In the CodeWarrior resource compiler,


   """Hi Mom"

compiles to


   "'Hi Mom'

and is combined to become


   'Hi Mom'

To place a double quotation mark inside a string, use \" instead of "".

The CodeWarrior resource compiler ignores directory paths in file names. For example, a resource statement such as
   12 BITMAP .\..\..\res\bits\junk.bmp

is read as


   12 BITMAP junk.bmp

Use the Access Paths settings panel to specify the directory in which to locate files. Refer to the IDE User Guide for details.

 

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000