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 Components / Targeting a Component Instance


ComponentSetTarget

You can use the ComponentSetTarget function to call a component's target request routine (that is, the routine that handles the kComponentTargetSelect request code). The target request informs a component that it has been targeted by another component.

You should not target a component instance if the component does not support the target request. Before calling this function, you should issue a can do request to the component instance you want to target to verify that the component supports the target request. If the component supports it, use the ComponentSetTarget function to send a target request to the component instance you wish to target. After receiving a target request, the targeted component instance should call the component instance that targeted it whenever the targeted component instance would normally call one of its defined functions.

FUNCTION ComponentSetTarget (ci: ComponentInstance;
                             target: ComponentInstance): LongInt;
ci
The component instance to which to send a target request (the component that has been targeted).
target
The component instance of the component issuing the target request.
DESCRIPTION
The ComponentSetTarget function returns a function result of badComponentSelector if the targeted component does not support the target request. Otherwise, the ComponentSetTarget function returns as its function result the value that the targeted component instance returned in response to the target request.

SEE ALSO
For details on how to handle the target request, see "Responding to the Target Request" on page 6-24.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996