Important: The information in this document is obsolete and should not be used for new development.
Getting Information About a Component
You can use theGetComponentInfofunction to retrieve information about a component, including the component name, icon, and other information. Listing 6-3 shows an application-defined procedure that retrieves information about a video digitizer component.Listing 6-3 Getting information about a component
PROCEDURE MyGetCompInfo (compName, compInfo, compIcon: Handle; VAR videoDesc: ComponentDescription); VAR videoCompID: Component; myErr: OSErr; BEGIN {first find a video digitizer component} MyFindVideoComponent(videoCompID); {now get information about it} IF videoCompID <> NIL THEN myErr := GetComponentInfo(videoCompID, videoDesc, compName, compInfo, compIcon); END;You specify the component in the first parameter toGetComponentInfo. You specify the component using either a component identifier (obtained fromFindNextComponentorRegisterComponent) or a component instance (obtained fromOpenDefaultComponentorOpenComponent).The
GetComponentInfofunction returns information about the component in the second through fifth parameters of the function. TheGetComponentInfofunction returns information about the component (such as its type, subtype, and manufacturer) in a component description record. The function also returns the component name, icon, and other information through handles. You must allocate these handles before callingGetComponentInfo. (Alternatively, you can specifyNILin thecompName,compInfo, andcompIconparameters if you do not want the information returned.) The icon returned in thecompIconparameter is a handle to a black-and-white icon. If a component has an icon family, you can retrieve a handle to its icon suite usingGetComponentIconSuite.