Important: The information in this document is obsolete and should not be used for new development.
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 theresult
parameter. Your handler should return thenoErr
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.