Carbon


AESetObjectCallbacks

Header: AEObjects.h Carbon status: Supported

Specifies the object callback functions for your application.

OSErr AESetObjectCallbacks (
    OSLCompareUPP myCompareProc, 
    OSLCountUPP myCountProc, 
    OSLDisposeTokenUPP myDisposeTokenProc, 
    OSLGetMarkTokenUPP myGetMarkTokenProc, 
    OSLMarkUPP myMarkProc, 
    OSLAdjustMarksUPP myAdjustMarksProc, 
    OSLGetErrDescUPP myGetErrDescProcPtr
);
Parameter descriptions
myCompareProc

Either a universal procedure pointer to the object comparison function provided by your application or NULL if no function is provided.

myCountProc

Either a universal procedure pointer to the object-counting function provided by your application or NULL if no function is provided.

myDisposeTokenProc

Either a universal procedure pointer to the token disposal function provided by your application or NULL if no function is provided. (Token is defined in AEDisposeToken.)

myGetMarkTokenProc

Either a universal procedure pointer to the function for returning a mark token provided by your application or NULL if no function is provided.

myMarkProc

Either a universal procedure pointer to the object-marking function provided by your application or NULL if no function is provided.

myAdjustMarksProc

Either a universal procedure pointer to the mark-adjusting function provided by your application or NULL if no function is provided.

myGetErrDescProcPtr

Either a universal procedure pointer to the error callback function provided by your application or NULL if no function is provided.

function result

A result code.

DISCUSSION

This function is just a convenient wrapper for AEInstallSpecialHandler. You can manipulate the special handler table with more control using the routines described in “Managing Special Handler Dispatch Tables”.

Your application can provide only one each of the object callback functions specified by AESetObjectCallbacks—one object comparison function, one object-counting function, and so on. As a result, each of these callback functions must perform the requested task (comparing, counting, and so on) for all the object classes that your application supports. In contrast, your application may provide many different object accessor functions if necessary, depending on the object classes and token types your application supports. You install object accessor functions with AEInstallObjectAccessor.

To replace object callback functions that have been previously installed, you can call AESetObjectCallbacks again. Each additional call to AESetObjectCallbacks replaces any object callback functions installed by previous calls. Only those functions you specify are replaced; to avoid replacing existing callback functions, specify a value of NULL for the functions you don’t want to replace.

You cannot use AESetObjectCallbacks to replace system object callback functions or object accessor functions. To install system object callback functions, use the function AEInstallSpecialHandler.

VERSION NOTES

A Carbon application should not install an object callback function in a system object accessor dispatch table with the goal that the function will get called when other applications access objects—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)