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 5 - Creating and Sending Apple Events / Reference to Creating and Sending Apple Events
Routines for Creating and Sending Apple Events / Creating Apple Events


AECreateAppleEvent

You can use the AECreateAppleEvent function to create an Apple event with several important attributes but no parameters. You add parameters to the Apple event after you create it.

FUNCTION AECreateAppleEvent (theAEEventClass: AEEventClass; 
                             theAEEventID: AEEventID; 
                             target: AEAddressDesc; 
                             returnID: Integer; 
                             transactionID: LongInt; 
                             VAR result: AppleEvent): OSErr;
theAEEventClass

The event class of the Apple event to be created.
theAEEventID

The event ID of the Apple event to be created.
target
The address of the server application.
returnID
The return ID for the Apple event; if you specify kAutoGenerateReturnID, the Apple Event Manager assigns a return ID that is unique to the current session.
transactionID
The transaction ID for this Apple event. A transaction is a sequence of Apple events that are sent back and forth between the client and server applications, beginning with the client's initial request for a service. All Apple events that are part of a transaction must have the same transaction ID.
result
The AECreateAppleEvent function returns, in this parameter, the Apple event that it creates.
DESCRIPTION
The AECreateAppleEvent function creates an Apple event.Your application is responsible for using the AEDisposeDesc function to dispose of the Apple event when you no longer need it.

If AECreateAppleEvent returns a nonzero result code, it returns a null descriptor record unless the Apple Event Manager is not available because of limited memory.

RESULT CODES
noErr0No error
memFullErr-108Not enough room in heap zone
SEE ALSO
See "Creating an Apple Event," which begins on page 5-3, for more information on how to create an Apple event.

See "Specifying a Target Address" on page 5-10 for information on how to address an Apple event.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996