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 / Registering Components


RegisterComponentResourceFile

The RegisterComponentResourceFile function registers all component resources in the given resource file according to the flags specified in the global parameter.

FUNCTION RegisterComponentResourceFile (resRefNum: integer;
                                        global: integer): LongInt;
resRefNum
The reference number of the resource file containing the components to register.
global
A set of flags that control the scope of the registration of the components in the resource file specified in the resRefNum parameter. You can use these flags to specify a value for the global parameter:
registerCmpGlobal = 1;
Specify this flag to indicate that each component in the resource file should be made available to other applications and clients as well as the one performing the registration. If you do not specify this flag, each component is available for use only by the registering application or component (that is, the component is local to the A5 world of the registering program).
registerCmpNoDuplicates = 2;
Specify this flag to indicate that if a component with identical characteristics to the one being registered already exists, then the new one should not be registered (RegisterComponentResourceFile returns 0 in this situation). If you do not specify this flag, the component is registered even if a component with identical characteristics to the one being registered already exists.
registerCompAfter = 4;
Specify this flag to indicate that as RegisterComponentResourceFile registers a component, it should register the component after all
other components with the same component type. Usually components are registered before others with identical descriptions; specifying this flag overrides that behavior.
DESCRIPTION
The RegisterComponentResourceFile function registers components in a resource file. If the RegisterComponentResourceFile function successfully registers all components in the specified resource file, RegisterComponentResourceFile returns a function result that indicates the number of components registered. If the RegisterComponentResourceFile function could not register one or more of the components in the resource file or if the specified file reference number is invalid, it returns a negative function result.

SEE ALSO
For a description of the format and content of component resources, see "Resources" beginning on page 6-77.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996