AEGetParamPtr
You can use the AEGetParamPtr function to get a pointer to a buffer that contains the data from a specified Apple event parameter.
FUNCTION AEGetParamPtr (theAppleEvent: AppleEvent;
theAEKeyword: AEKeyword;
desiredType: DescType;
VAR typeCode: DescType; dataPtr: Ptr;
maximumSize: Size;
VAR actualSize: Size): OSErr;
theAppleEvent
- The Apple event containing the desired parameter.
theAEKeyword
-
The keyword that specifies the desired parameter.
desiredType
- The desired descriptor type for the data to be returned; if the requested Apple event parameter is not of this type, the Apple Event Manager attempts to coerce it to 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 Apple event parameter.
typeCode
- The descriptor type of the returned data.
dataPtr
- A pointer to the buffer in which the returned data is stored.
maximumSize
-
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.
actualSize
- The length, in bytes, of the data for the specified Apple event parameter. If this value is larger than the value of the
maximumSize parameter, not all of the data for the parameter was returned.
DESCRIPTION
The AEGetParamPtr function uses a buffer to return the data from a specified Apple event parameter, which it attempts to coerce to the descriptor type specified by the desiredType parameter.
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 |
| 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 |
SEE ALSO
For examples of the use of AEGetParamPtr, see "Getting Data Out of an Apple Event," which begins on page 4-25.