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
Routines for Responding to Apple Events / Creating and Managing the Apple Event Dispatch Tables


AEGetEventHandler

You can use the AEGetEventHandler function to get an entry from an Apple event dispatch table.

FUNCTION AEGetEventHandler (theAEEventClass: AEEventClass; 
                            theAEEventID: AEEventID; 
                            VAR handler: EventHandlerProcPtr; 
                            VAR handlerRefcon: LongInt; 
                            isSysHandler: Boolean): OSErr;
theAEEventClass
The value of the event class field of the dispatch table entry for the desired handler.
theAEEventID
The value of the event ID field of the dispatch table entry for the desired handler.
handler
The AEGetEventHandler function returns, in this parameter, a pointer to the specified handler.
handlerRefcon
The AEGetEventHandler function returns, in this parameter, the reference constant from the dispatch table entry for the specified handler.
isSysHandler

Specifies the Apple event dispatch table from which to get the handler. If the value of isSysHandler is TRUE, the AEGetEventHandler function returns the handler from the system dispatch table. If the value is FALSE, AEGetEventHandler returns the handler from your application's dispatch table.
DESCRIPTION
The AEGetEventHandler function returns, in the handler parameter, a pointer to the handler for the Apple event dispatch table entry you specify in the parameters theAEEventClass and theAEEventID. You can use the typeWildCard constant for either or both of these parameters; however, AEGetEventHandler returns an error unless an entry exists that specifies typeWildCard in exactly the same way. For example, if you specify typeWildCard in both the theAEEventClass parameter and the theAEEventID parameter, the Apple Event Manager will not return the first handler for any event class and event ID in the dispatch table; instead, the dispatch table must contain an entry that specifies type typeWildCard for both the event class and the event ID.

RESULT CODES
noErr0No error
errAEHandlerNotFound-1717No handler found for an Apple event
SEE ALSO
For an explanation of wildcard values, see the description of the AEInstallEventHandler function on page 4-62.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996