![]() |
RegisterComponentResource |
||||
Header: | Components.h | Carbon status: | Supported | |
Registers a component stored in a resource file.
Component RegisterComponentResource ( ComponentResourceHandle cr, SInt16 global );
A handle to a component resource that describes the component to be registered. The component resource contains all the information required to register the component. Components you register with this function must be stored in a resource file as a component resource. The Component Manager automatically registers component resources stored in files with file types of 'thng' that are stored in the Extensions folder. See Resources for more information on component resource files.
A set of flags that controls the scope of component registration. See
The unique component identifier assigned to the component by the Component Manager, or NULL if the function could not register the component.
Before a component can be used by an application, the component must be registered with the Component Manager. Applications can then find and open the component using the standard Component Manager functions.
If you want to register a component that is in memory, use the RegisterComponent function.
This function does not actually load the code specified by the component resource into memory. Rather, the Component Manager loads the component code the first time an application opens the component. If the code is not in the same file as the component resource or if the Component Manager cannot find the file, the open request fails.
Note that a component registered locally by your application remains registered until your application unregisters it or quits. When an application quits, the Component Manager automatically closes any component connections to that application. In addition, if the application has registered components that reside in its heap space, the Component Manager automatically unregisters those components. A component registered globally by your application remains registered until your application unregisters it or until the computer is shut down.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)