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 10/2/01.   Tuesday, October 2, 2001 daytail

Resource limits in CodeWarrior

There is a fundamental limit in the CodeWarrior for Palm OS Platform toolchain that most people don't hit, though it comes up from time to time.

CW's Palm OS support is based on Macintosh format resource files. A Mac file can have at most around 2800 resources -- it is a hard-coded limit from a very long time ago. Then you modify a .rsrc file in Constructor, you're actually modifying a Mac-format resource file, so it has to respect that limit. Each form is a resource, as well as each item on a form and each additional resource.

If you split up the .rsrc files, you can get around this limit, but it hits you again at link time. The first stage of linking with CodeWarrior combines your code and resources into a prototype Macintosh application. Being a Mac file, your app has a 2800 resource limit as well. The post linker turns that proto-Mac app into a PRC file for loading on the Palm device, and its only after that transformation when resource limits are lifted.

If you hit this limit, there isn't a clean answer for getting around it. You might think you could use the PilRC plugin, but it hits the same limits as Constructor, since its using Rez, a Mac resource description language, as an intermediate form.

The best you can do now is split your application into two parts: your primary application (with your code and some of your resources) and a dummy application that just holds the other set resources. Make the dummy app type 'rsrc' or something like that. Then, when your first application stars, do a DmOpenDatabase on the second app with the additional resources, and they will be added to your resource chain.

brought to you by weblogger.com

 
October 2001
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  
Sep   Nov


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