Carbon


AECreateDesc

Header: AEDataModel.h Carbon status: Supported

Creates a new descriptor record that incorporates the specified data.

OSErr AECreateDesc (
    DescType typeCode, 
    const void *dataPtr, 
    Size dataSize, 
    AEDesc *result
);
typeCode

The descriptor type for the new descriptor record. For a list of AppleScript’s predefined descriptor types, see “Descriptor Type Constants”.

dataPtr

A pointer to the data for the new descriptor record.

dataSize

The length, in bytes, of the data for the new descriptor record.

result

A pointer to a descriptor record. On successful return, a descriptor record that incorporates the data specified by the dataPtr parameter. On error, a null descriptor. Your application should always call the AEDisposeDesc function to dispose of the resulting descriptor record after it has finished using it.

function result

A result code.

DISCUSSION

While it is possible to create an Apple event descriptor or a descriptor list or a descriptor record with the AECreateDesc function (assuming you have access to the raw data for an Apple event, list, or descriptor), you typically create these structured objects with their specific creation routines—AECreateAppleEvent, AECreateList, or AECreateDesc.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)