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


The FindNextComponent function returns the component identifier for the next registered component that meets the selection criteria specified by your application. You specify the selection criteria in a component description record.

Your application can use the component identifier returned by this function to get more information about the component or to open the component.

FUNCTION FindNextComponent (aComponent: Component; 
                            looking: ComponentDescription)
                            : Component;
The starting point for the search. Set this field to 0 to to start the search at the beginning of the component list. If you are continuing a search, you can specify a component identifier previously returned by the FindNextComponent function. The function then searches the remaining components.
A component description record. Your application specifies the criteria for the component search in the fields of this record.
The Component Manager ignores fields in the component description record that are set to 0. For example, if you set all the fields to 0, all components meet the search criteria. In this case, your application can retrieve information about all of the components that are registered in the system by repeatedly calling FindNextComponent and GetComponentInfo until the search is complete. Similarly, if you set all fields to 0 except for the componentManufacturer field, the Component Manager searches all registered components for a component supplied by the manufacturer you specify. Note that the FindNextComponent function does not modify the contents of the component description record you supply. To retrieve detailed information about a component, you need to use the GetComponentInfo function to get the component description record for each returned component.
The FindNextComponent function returns the component identifier of a component that meets the search criteria. FindNextComponent returns a function result of 0 when there are no more matching components.

Use the GetComponentInfo function, described on page 6-45, to retrieve more information about a component. To open a component, use the OpenDefaultComponent or OpenComponent function, described on page 6-42 and page 6-44, respectively. See page 6-36 for information on the component description record.

See Listing 6-1 on page 6-8 for an example of searching for a specific component.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996