Important: The information in this document is obsolete and should not be used for new development.
LoadResource
You can use theLoadResource
procedure to get resource data after you've calledSetResLoad
with theload
parameter set toFALSE
or when the resource is purgeable.
PROCEDURE LoadResource (theResource: Handle);
theResource
- A handle to a resource.
DESCRIPTION
Given a handle to a resource,LoadResource
reads the resource data into memory. If the resource is already in memory, or if thetheResource
parameter doesn't contain a handle to a resource, thenLoadResource
does nothing. To determine whether either of these situations occurred, callResError
. If the resource is already in memory,ResError
returnsnoErr
; if the handle is not a handle to a resource,ResError
returnsresNotFound
.SPECIAL CONSIDERATIONS
If 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,LoadResource
rereads the original resource from the file's resource fork. You should useChangedResource
orSetResPurge
before callingLoadResource
to ensure that changes made to purgeable resources are written to the resource fork.ASSEMBLY-LANGUAGE INFORMATION
TheLoadResource
procedure preserves all registers.RESULT CODES
noErr 0 No error resNotFound -192 Resource not found SEE ALSO
To check for errors, call theResError
function as described on page 1-47.For information about the
SetResLoad
,ChangedResource
, andSetResPurge
procedures, see page 1-74, page 1-83, and page 1-89, respectively.