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
Application-Defined Routine /


MyComponent

Here's how to declare a component function named MyComponent:

FUNCTION MyComponent (params: ComponentParameters;
                      storage: Handle): ComponentResult;
params
A component parameters record. The what field of the component parameters record indicates the action your component should perform. The parameters that the client invoked your function with are contained in the params field of the component parameters record. Your component can use the CallComponentFunction or CallComponentFunctionWithStorage routine to extract the parameters from this record.
storage
A handle to any memory that your component has associated with the connection. Typically, upon receiving an open request, your component allocates memory and uses the SetComponentInstanceStorage function to associate the allocated memory with the component connection.
DESCRIPTION
When your component receives a request, it should perform the action specified in the what field of the component parameters record. Your component should return a value of type ComponentResult (a long integer). If your component does not return error information as its function result, it should indicate errors using the SetComponentInstanceError procedure.

SEE ALSO
For information on the component parameters record, see page 6-52. For information on writing a component, see "Creating Components" beginning on page 6-12.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996