Re: .rsrc how to
Re: .rsrc how to
- Subject: Re: .rsrc how to
- From: Ricky Sharp <email@hidden>
- Date: Fri, 13 Oct 2006 10:49:33 -0500
On Friday, October 13, 2006, at 08:54AM, <email@hidden> wrote:
>If you need to open .rsrc files in your program, you'll most likely have to
>use Carbon Calls to open the resource fork of the file you want. You can then
>use Resource manager calls to manipulate the individual resources.
>
>I'm new to Cocoa, there may be Cocoa API's that can do this, but I doubt it.
There are no Cocoa wrappers (at least that Apple supplies) around the Carbon Resource Manager.
For the conversion part of my app (converts older res-based documents), I use the ResMgr APIs to obtain the resource data and just map them in memory-based structures.
>From there, I can do whatever I want. Just be careful to realize...
(1) resources are 16-bit aligned; use appropriate pragma pack, et. al to wrap your structs so that they map to the loaded resources correctly.
(2) The built in res-types (16-bit, 32-bit, etc. scalars) are all BigEndian so be sure to add in byte-swapping. You'll typically use the "NSSwapBigEndianToHost" functions. Although, it could be the case where a resource contains a blob of data such that the original developer defined its "endian-ness".
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden