Important: The information in this document is obsolete and should not be used for new development.
AECoercePtr
You can use theAECoercePtr
function to coerce data to a desired descriptor type. If successful, it creates a descriptor record containing the newly coerced data.
FUNCTION AECoercePtr (typeCode: DescType; dataPtr: Ptr; dataSize: Size; toType: DescType; VAR result: AEDesc): OSErr;
typeCode
- The descriptor type of the source data.
dataPtr
- A pointer to the data to be coerced.
dataSize
- The length, in bytes, of the data to be coerced.
toType
- The desired descriptor type of the resulting descriptor record.
result
- The resulting descriptor record.
DESCRIPTION
TheAECoercePtr
function creates a new descriptor record by coercing the specified data to a descriptor record of the specified descriptor type. You should use theAEDisposeDesc
function to dispose of the resulting descriptor record once you are finished using it.If
AECoercePtr
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
noErr 0 No error memFullErr -108 Not enough room in heap zone errAECoercionFail -1700 Data could not be coerced to the requested descriptor type SEE ALSO
For a description of theAEDisposeDesc
function, see page 4-93.