In article <84928@palm-dev-forum>, [EMAIL PROTECTED] says...
> From: Joe (view other messages by this author)
> Date: Thu, 25 Apr 2002 06:00:26
> > In CW7, when you add a file to the project (Select Project, then Add
> > Files..., then locate and highlight the file to be added and click the
> > Add button) if your project has multiple targets you will be asked
> > which targets you want to add the file to.
> 
> Yes, each time I tried deleting and re-adding all my src files (to try to
> get them show up without n/a for the new target) I'd selected all targets.
> They would always get added to all targets, but for some of them, the
> code/data would have "n/a"

You should always see n/a for resource files, Rez files, PilRC files, or 
anything like that that just adds resources to the project.

You might find it useful to use the project inspector.  This is the icon 
in your project window that looks like a little dialog box.  Click this, 
then click on files to see what CodeWarrior knows about them.  You can 
also then click on the Targets tab in the inspector and pick the set of 
targets to which these files belong.

> I still don't understand why there needs to be a file with 0 bytes. Do you
> mean that I should create a new directory for my new rsrc file (like
> Project/RESOURCE_NEWTARGET.FRK/myrsrc_newtarget.rsrc) or just create a copy
> in the same directory (like Project/RESOURCE.FRK/myrsrc_newtarget.rsrc)
> Also, which of the two rsrc files does CW expect me to add to the project--
> the 0 byte or non-zero byte version?  BTW, What does fork mean in this
> context? :)

On the Macintosh, all files have two forks: a data fork and a resource 
fork.  The data fork is just a binary file -- any data can be stored 
there and its in an application specific format.  The resource fork is 
structured storage where binary records are tagged with a resource type 
and ID.

When Apple produced their PC Exchange software that let the Mac read and 
write DOS-formatted 1.44MB floppy disks, they invented this RESOURCE.FRK 
mechanism to allow Macintosh files to be saved on a DOS disk.  This 
storage method got used by the Mac2Win porting library that was used in 
the port of Constructor for Palm OS to Windows.

In this scheme, the abstract Mac OS file is composed of a two DOS files, 
but at runtime, you just point to the data fork file, with the resources 
being found in the RESOURCE.FRK folder in the same location.

Constructor (and other Mac OS resource editors) create files with no 
data, but lots of resources.  This is why you get a 0-byte file and then 
a larger file in RESOURCE.FRK with all the resource data.  CW wants you 
to add the 0-byte file to your project, so the 68K Linker can 
reintegrate everything correctly, since it knows about this convention 
also.

-- 
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Get help at http://palmoswerks.com/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to