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 and Duplicating Descriptor Records


AEDuplicateDesc

You can use the AEDuplicateDesc function to make a copy of a descriptor record.

FUNCTION AEDuplicateDesc (theAEDesc: AEDesc;
                          VAR result: AEDesc): OSErr;
theAEDesc
The descriptor record to be duplicated.
result
The duplicate descriptor record.
DESCRIPTION
The AEDuplicateDesc function creates a new descriptor record by copying the descriptor record from the parameter theAEDesc. Your application is responsible for using the AEDisposeDesc function to dispose of the resulting descriptor record when you no longer need it. You normally do this after receiving a result code from the AESend function.

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

It is common for applications to send Apple events that have one or more attributes or parameters in common. For example, if you send a series of Apple events to the same application, the address attribute is the same. In these cases, the most efficient way to create the necessary Apple events is to make a template Apple event that you can then copy--by calling the AEDuplicateDesc function--as needed. You then fill in or change the remaining parameters and attributes of the copy, send the copy by calling AESend, and dispose of the copy--by calling AEDisposeDesc--after AESend returns a result code.

RESULT CODES
noErr0No error
memFullErr-108Not enough room in heap zone

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996