Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 1 - Resource Manager / Resource Manager Reference
Resource Manager Routines / Getting and Setting the Current Resource File


To get the file reference number associated with a particular resource, use the HomeResFile function.

FUNCTION HomeResFile (theResource: Handle): Integer;
A handle to a resource.
Given a handle to a resource, the HomeResFile function returns the file reference number for the resource fork containing the specified resource. If the given handle isn't a handle to a resource, HomeResFile returns -1, and the ResError function returns the result code resNotFound. If HomeResFile returns 0, the resource is in the System file's resource fork. If HomeResFile returns 1, the resource is ROM-resident.

noErr0No error
resNotFound-192Resource not found
To check for errors, call the ResError function as described on page 1-47.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996