LoadResourceYou can use the
LoadResourceprocedure to get resource data after you've called
loadparameter set to
FALSEor when the resource is purgeable.
PROCEDURE LoadResource (theResource: Handle);
- A handle to a resource.
DESCRIPTIONGiven a handle to a resource,
LoadResourcereads the resource data into memory. If the resource is already in memory, or if the
theResourceparameter doesn't contain a handle to a resource, then
LoadResourcedoes nothing. To determine whether either of these situations occurred, call
ResError. If the resource is already in memory,
noErr; if the handle is not a handle to a resource,
SPECIAL CONSIDERATIONSIf you've changed the resource data for a purgeable resource and the resource is purged before being written to the file, the changes will be lost. In this case,
LoadResourcerereads the original resource from the file's resource fork. You should use
LoadResourceto ensure that changes made to purgeable resources are written to the resource fork.
LoadResourceprocedure preserves all registers.
noErr 0 No error resNotFound -192 Resource not found
SEE ALSOTo check for errors, call the
ResErrorfunction as described on page 1-47.
For information about the
SetResPurgeprocedures, see page 1-74, page 1-83, and page 1-89, respectively.