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: Interapplication Communication /
Chapter 4 - Responding to Apple Events / Reference to Responding to Apple Events
Application-Defined Routines /


MyCoercePtr

A coercion handler that accepts a pointer to data has the following syntax:

FUNCTION MyCoercePtr (typeCode: DescType; dataPtr: Ptr; 
                      dataSize: Size; toType: DescType; 
                      handlerRefcon: LongInt;
                      VAR result: AEDesc): OSErr; 
typeCode
The descriptor type of the original data.
dataPtr
A pointer to the data to coerce.
dataSize
The length, in bytes, of the data to coerce.
toType
The desired descriptor type for the resulting descriptor record.
handlerRefcon
A reference constant that is stored in the coercion dispatch table entry for the handler and passed to the handler by the Apple Event Manager whenever the handler is called.
result
The resulting descriptor record.
DESCRIPTION
Your coercion handler should coerce the data to the desired descriptor type and return the resulting data in the descriptor record specified by the result parameter. Your handler should return the noErr result code if your handler successfully performs the coercion, and a nonzero result code otherwise.

SEE ALSO
For more information, see "Writing and Installing Coercion Handlers" on page 4-41.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996