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 Applications / Getting Information About Components


GetComponentInfo

The GetComponentInfo function returns all of the registration information for a component. Your application specifies the component with a component identifier returned by the FindNextComponent function. The GetComponentInfo function returns information about the component in a component description record. The GetComponentInfo function also returns the component's name, information string, and icon. (To get a handle to the component's icon suite, if it provides one, use the GetComponentIconSuite function.)

A component provides this registration information when it is registered with the Component Manager.

FUNCTION GetComponentInfo (aComponent: Component; 
                           VAR cd: ComponentDescription; 
                           componentName: Handle; 
                           componentInfo: Handle; 
                           componentIcon: Handle): OSErr;
aComponent
A component identifier that specifies the component for the operation. Your application obtains a component identifier from the FindNextComponent function. If your application registers a component, it can also obtain a component identifier from the RegisterComponent or RegisterComponentResource function.
You may supply a component instance rather than a component identifier to this function. (If you do so, you must coerce the data type appropriately.) Your application can obtain a component instance from the OpenComponent function or the OpenDefaultComponent function.
cd
A component description record. The GetComponentInfo function returns information about the specified component in a component description record.
componentName
An existing handle that is to receive the component's name. If the component does not have a name, the GetComponentInfo function returns an empty handle. Set this field to NIL if you do not want to receive the component's name.
componentInfo
An existing handle that is to receive the component's information string. If the component does not have an information string, the GetComponentInfo function returns an empty handle. Set this field to NIL if you do not want to receive the component's information string.
componentIcon
An existing handle that is to receive the component's icon. If the component does not have an icon, the GetComponentInfo function returns an empty handle. Set this field to NIL if you do not want to receive the component's icon.
DESCRIPTION
The GetComponentInfo function returns information about the specified component in the cd, componentName, componentInfo, and componentIcon parameters.

RESULT CODES
noErr0No error
invalidComponentID-3000No component with this component identifier
SEE ALSO
For information on the component description record, see page 6-36. For information on the FindNextComponent function, see page 6-40. For information on registering components, see "Registering Components" beginning on page 6-55.

For an example of the use of the GetComponentInfo function, see Listing 6-3 on page 6-10.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996