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 6 - Component Manager / Component Manager Reference
Routines for Components


Accessing a Component's Resource File

If you store your component in a component resource and register your
component using the RegisterComponentResource function or RegisterComponentResourceFile function, or if the Component Manager automatically registers your component, the Component Manager allows your component to gain access to its resource file. You can store read-only data for
your component in its resource file. For example, the resource file may contain the color icon for the component, static data needed to initialize private storage, or any other data that may be useful to the component. Note that there is only one resource file associated with a component.

If you store your component in a component resource but register the component with the RegisterComponent function, rather than with the RegisterComponentResource or RegisterComponentResourceFile function, your component cannot access its resource file with the routines described in this section.

The routines described in this section allow your component to gain access to its resource file. These routines provide read-only access to the data in the resource file. If your component opens its resource file, it must close the file before returning to the calling application.

Use the OpenComponentResFile function to open your component's resource file. Use the CloseComponentResFile function to close the resource file before returning to the calling application.


Subtopics
OpenComponentResFile
CloseComponentResFile

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996