bartop

palmoswerks ARCHIVE
Palm OS programming tips from a (former) CodeWarrior insider

header

Navigation

Search
Home
About
Stories
Stuff I Like
Articles
PilRC
CodeWarrior
palmos.techwood.org
DevTools List
Palm OS Dev FAQ

 Permanent link to archive for 1/10/02.   Thursday, January 10, 2002 daytail

DeRezing RSRC Files

Constructor for Palm OS exclusively works on Macintosh resource files (RSRC files). However, its a fairly simple task to use the IDE to decompile a .RSRC file in to a .R file, which is a textual description of the Macintosh resources used. You might want to do this to make version control easier, or to transport resources from the Mac to Windows without having to deal with resource fork conversion.

To do this, you need to setup a few things. First, in the Rez panel, set the prefix file to UIResDefs.r. This isn't totally needed, but it will make the output more understandable.

Second, go to the file mappings panel. Find all of the entries with "RSRC" or "rsrc" in their type or extension. Set all of these to have the compiler "Rez" rather than the default "None". You have to both select the compiler, then hit the Change button to get this to take.

Now, right click on your .rsrc file in the project window. You have a new command, "Disassemble". When you use this, you'll get a new IDE window with a textual representation of the RSRC. This file can be saved directly with a ".r" extension, then added back to your project and used instead of your .rsrc file.

If you want to go back the other way, you need the CW Palm V8 toolset. Make a new, empty target. Set the linker to "Mac OS Merge", and add your .r file as the only item. Then, go to the Merge settings panel and name your .rsrc file. This will compile the .r into Mac resources, then produce a new .rsrc as output. We use this technique in the Palm OS wizards in V8 -- the new resources are generated as from a .r template, then we use the Mac OS Merge linker to build the final .rsrc which is inserted into both application targets.

brought to you by weblogger.com

 
January 2002
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31  
Nov   Feb


Send feedback to combee@techwood.org
Copyright © 2004 Benjamin L. Combee
Palm OS is a registered trademark of PalmSource, Inc.
Metrowerks and CodeWarrior are registered trademarks of Metrowerks Inc.

The views expressed on this website/weblog are those of mine alone and do not necessarily reflect the views of PalmSource or Metrowerks.

This is a Manila Site

qwertYAK / frobnovich