AEGetParamPtr
AEGetParamPtr Access Apple Event parameters
#include <AppleEvents.h> Apple Event Manager
OSErr AEGetParamPtr ( theAppleEvent, theAEKeyword, desiredType,
typeCode, dataPtr, maximumSize, actualSize );
AppleEvent * theAppleEvent ; Apple event record
AEKeyword theAEkeyword ; Apple Event keyword
DescType desiredType ; Descriptor type
DescType * typeCode ; pointer to descriptor type
Ptr dataPtr ; pointer to data buffer
Size maximumSize ; maximum size of data buffer
Size * actualSize ; actual size of data field
returns Error Code; 0 = no error
You can use the AEGetParamPtr function to get a pointer to a buffer that
contains the data from a specified Apple event parameter.
You use the AEGetParamPtr and AEGetParamDesc functions to gain access
to the parameters of an Apple event. You use the AEGetAttributePtr and
AEGetAttributeDesc functions to gain access to the attributes of an Apple
event.
The AEGetParamPtr function uses a buffer to return the data from a
specified Apple event. parameter, which it attempts to coerece to the descriptor
type specified by the desiredType parameter.
The parameter theAppleEvent is the Apple event containing the desired
parameter.
The parameter theAEKeyword is the keyword that specifies the desired
parameter.
The desiredType parameter specifies the descriptor type of the resulting data;
if the desired parameter is not of this type, the
Apple Event Manager attempts to coerce it into this type. If the value of
desiredType is typeWildCard, no coercion is performed, and the descriptor
type of the returned data is the same as the descriptor type of the parameter.
The returned data's descriptor type is returned in the typeCode parameter.
The dataPtr parameter is a pointer to the buffer for storing the returned data.
The maximumSize parameter is the maximum length, in bytes, of the data to
be returned. You must allocate at least this amount of storage for the buffer
specified by the dataPtr parameter.
The AEGetParamPtr function returns in the actualSize parameter the
actual length, in bytes, of the data for theAppleEvent parameter. If this value
is larger than the value of maximumSize, not all of the data for theAppleEvent
parameter was returned.
Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone
errAECoercionFail (-1700) Data could not be coerced to descriptor type
errAEDescNotFound (-1701) Descriptor record was not found
errAEWrongDataType (-1703) Wrong descriptor type
errAENotAEDesc (-1704) Not a valid descriptor record
errAEReplyNotArrived (-1718) Reply has not yet arrived