Important: The information in this document is obsolete and should not be used for new development.
AERemoveSpecialHandler
You can use theAERemoveSpecialHandlerfunction to remove a handler from a special handler table.
FUNCTION AERemoveSpecialHandler (functionClass: AEKeyword; handler: ProcPtr; isSysHandler: Boolean): OSErr;
functionClass
The keyword for the special handler to be removed. In addition to the constants for object callback functions listed on page 4-100, two other values are allowed for thefunctionClassparameter:keyPreDispatchandkeySelectProc. ThekeyPreDispatchconstant identifies a handler with the same parameters as an Apple event handler that is called immediately before the Apple Event Manager dispatches an Apple event. ThekeySelectProcconstant indicates that you want to disable the Object Support Library--that is, all the routines described in the chapter "Resolving and Creating Object Specifier Records" in this book (see the description that follows for more information).handler- A pointer to the special handler to be removed. Although the
functionClassparameter would be sufficient to identify the handler to be removed, providing thehandlerparameter is a safeguard that you remove the correct handler.isSysHandler
Specifies the special handler dispatch table from which to remove the handler. If the value of this parameter isTRUE, the handler is taken from the system special handler dispatch table. If the value isFALSE, the handler is removed from the application special handler dispatch table.DESCRIPTION
In addition to using theAERemoveSpecialHandlerfunction to remove specific special handlers, you can use the function to disable, within your application only, all Apple Event Manager routines that support Apple event objects--that is, all the routines available to your application as a result of linking the Object Support Library (OSL) and calling theAEObjectInitfunction.An application that expects its copy of the OSL to move after it is installed--for example, an application that keeps it in a stand-alone code resource--would need to do this. When an application calls
AEObjectInitto initialize the OSL, the OSL installs the addresses of its routines as extensions to the pack. If those routines move, the addresses become invalid.To disable the OSL, you should pass the keyword
keySelectProcin thefunctionClassparameter,NILin thehandlerparameter, andFALSEin theisSysHandlerparameter. Once you have called theAERemoveSpecialHandlerfunction with these parameters, subsequent calls by your application to any of the Apple Event Manager routines that support Apple event objects will return errors. To initialize the OSL after disabling it with theAERemoveSpecialHandlerfunction, your application must callAEObjectInitagain.If you expect to initialize the OSL and disable it several times, you should call
AERemoveObjectAccessorto remove your application's object accessor functions from your application's object accessor dispatch table before you callAERemoveSpecialHandler.RESULT CODES
noErr 0 No error memFullErr -108 Not enough room in heap zone errAENotASpecialFunction -1714 Wrong keyword for a special function