Resource Writing Questions 
Author Message
 Resource Writing Questions

I'm trying to write values to specific byte ranges in a resource.

I have been using addresource but it requires parameters that relate to
the resources type, id and name. but I don't get how to write to a
specific byte.

For Example I need to write the string "AIFF" starting at the 69th byte
or the string "twos" starting at the 4th byte if possible. Also will
the bytes before and after that don't get any data automatically be set
to 0 or do I have to set those too?

Any code or examples will be greatly appreciated.

Thanks

remove "removthistoreply" to reply via e-mail



Mon, 19 Jan 2004 07:40:56 GMT  
 Resource Writing Questions

Quote:

> I'm trying to write values to specific byte ranges in a resource.

> I have been using addresource but it requires parameters that relate to
> the resources type, id and name. but I don't get how to write to a
> specific byte.

But that's how resources work!  Every resource has a type and id (name
is optional).  A resource fork is essentially a database containing
multiple resource objects.  I suppose you could write to a specific
byte in a resource fork, but you'd darn well better understand the
format of the resource fork before you do so, or you'll corrupt
something.

If you want to write to a specific byte within the resource data
obtained from GetResource, stick it in a MemoryBlock and then access
what you want that way.  (Look up MemoryBlock in the Language Guide.)



Mon, 19 Jan 2004 08:51:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to writing STR# to Resources file?

2. Read/Write with resources

3. read/write a STR# resource

4. Writing to app's resource fork

5. Writing to resources…

6. Writing to a TEXT resource?

7. Writing to resources

8. write/modify resources?

9. Resources for writing help files

10. Writing Code Resources for V/Mac

11. Help! How to write MS excel Resource

12. Resource Fork has no Resource Fork?

 

 
Powered by phpBB® Forum Software