Component Manager

Find and use components in your app or add custom components to system-provided services, such as QuickTime and Core Audio.

Topics

Finding Components

CountComponents

Returns the number of registered components that meet the selection criteria specified by your application.

FindNextComponent

Returns the component identifier for the next registered component that meets the selection criteria specified by your application.

GetComponentListModSeed

Allows your application to determine if the list of registered components has changed.

Opening and Closing Components

OpenComponent

Opens a connection to the component with the component identifier specified by your application.

OpenDefaultComponent

Opens a connection to a registered component of the component type and subtype specified by your application.

CloseComponent

Terminates your application’s connection to a component.

Getting Information About Components

GetComponentInfo

Returns to your application the registration information for a component.

Retrieving Component Errors

GetComponentInstanceError

Returns to your application the last error generated by a specific connection to a component.

Accessing the Thread Safety Mode

CSSetComponentsThreadMode

Sets whether or not using thread-unsafe components is allowed in the current thread.

CSGetComponentsThreadMode

Indicates whether using thread-unsafe components is allowed in the current thread.

Creating and Managing Universal Procedure Pointers

NewComponentRoutineUPP

Creates a new universal procedure pointer (UPP) to a component routine callback function.

InvokeComponentRoutineUPP

Calls your component routine callback function

DisposeComponentRoutineUPP

Disposes of the universal procedure pointer (UPP) to a component routine callback function.

Registering Components

RegisterComponent

Registers a component stored in memory.

RegisterComponentResource

Registers a component stored in a resource file.

RegisterComponentResourceFile

Registers all component resources in the given resource file.

UnregisterComponent

Removes a component from the Component Manager’s registration list.

Dispatching to Component Functions

CallComponentFunction

Invokes the specified function of your component.

CallComponentFunctionWithStorage

Invokes the specified function of your component.

Managing Component Connections

CountComponentInstances

Determines the number of open connections being managed by a specified component.

GetComponentInstanceStorage

Allows your component to retrieve a handle to the memory associated with a connection.

SetComponentInstanceStorage

Allows your component to associate memory with a connection.

Setting Component Errors

SetComponentInstanceError

Passes error information to the Component Manager which sets the current error value for the appropriate connection.

Working With Component Reference Constants

GetComponentRefcon

Retrieves the value of the reference constant for your component.

SetComponentRefcon

Sets the reference constant for your component.

Accessing a Component’s Resource File

OpenComponentResFile

Allows your component to gain access to its resource file.

CloseComponentResFile

Closes the resource file that your component opened previously with the OpenComponentResFile function.

Calling Other Components

DelegateComponentCall

Allows your component to pass on a request to a specified component.

Capturing Components

CaptureComponent

Allows your component to capture another component.

UncaptureComponent

Allows your component to uncapture a previously captured component.

Changing the Default Search Order

SetDefaultComponent

Changes the search order for registered components.

Callbacks

ComponentRoutineProcPtr

Defines a pointer to your component callback function, which serves as the main entry point into your component and performs the component’s services.

Result Codes

The result codes defined by the Component Manager are listed below.

invalidComponentID

Invalid component ID.

validInstancesExist

This component has open connections.

componentNotCaptured

This component has not been captured.

badComponentSelector

Component does not support the specified request code.

badComponentInstance

Invalid component passed to Component Manager.

See Also

Managers

Alias Manager

Create and resolve alias records that describe file system objects such as files, directories, and volumes.

File Manager

Interact with files, folders, and volumes.

Gestalt Manager

Investigate the operating environment of your app.

Text Encoding Conversion Manager

Handle text encoding conversion between apps and transfer text across different platforms.