Carbon


AEGetCoercionHandler

Header: AEDataModel.h Carbon status: Supported

Gets the coercion handler for a specified descriptor type.

OSErr AEGetCoercionHandler (
    DescType fromType, 
    DescType toType, 
    AECoercionHandlerUPP *handler, 
    SInt32 *handlerRefcon, 
    Boolean *fromTypeIsDesc, 
    Boolean isSysHandler
);
Parameter descriptions
fromType

The descriptor type of the data coerced by the handler. For a list of AppleScript’s predefined descriptor types, see “Descriptor Type Constants”.

toType

The descriptor type of the resulting data. For a list of AppleScript’s predefined descriptor types, see “Descriptor Type Constants”.

handler

A universal procedure pointer. On return, a pointer to the specified handler, if a coercion table entry exists that exactly matches the values supplied in the parameters fromType and toType.

handlerRefcon

A pointer to a reference constant. On return, the reference constant from the coercion table entry for the specified coercion handler. The Apple Event Manager passes this reference constant to the handler each time it calls the handler. The reference constant may have a value of 0.

fromTypeIsDesc

A pointer to a Boolean value. The AEGetCoercionHandler function returns a value of TRUE in this parameter if the coercion handler expects the data as a descriptor record or FALSE, if the coercion handler expects a pointer to the data.

isSysHandler

Specifies the coercion table to get the handler from. Pass TRUE to get the handler from the system coercion table or FALSE to get the handler from your application’s coercion table. Use of the system coercion table is not recommended for Carbon applications.

function result

A result code.

VERSION NOTES

A Carbon application should not install a coercion handler in a system coercion handler dispatch table with the goal that the handler will get called when other applications perform coercions—this won’t necessarily work. See “Apple Event Dispatching” (to be supplied later) for more information.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)