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


You can use the CurResFile function to get the file reference number of the current resource file.

FUNCTION CurResFile: Integer;
The CurResFile function returns the file reference number associated with the current resource file. You can call this function when your application starts up (before opening the resource fork of any other file) to get the file reference number of your application's resource fork.

If the current resource file is the System file, CurResFile returns the actual file reference number. You can use this number or 0 with routines that take a file reference number for the System file. All Resource Manager routines recognize both 0 and the actual file reference number as referring to the System file.

The current resource file's reference number is stored in the global variable CurMap.

noErr0No error
To check for errors, call the ResError function as described on page 1-47.

For an example of the use of the CurResFile function, see Listing 1-8 on page 1-23.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996