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 / Adding Parameters and Attributes to Apple Events


AEPutAttributePtr

You can use the AEPutAttributePtr function to add a pointer to data, a descriptor type, and a keyword to an Apple event as an attribute.

FUNCTION AEPutAttributePtr (theAppleEvent: AppleEvent;
                            theAEKeyword: AEKeyword; 
                            typeCode: DescType; 
                            dataPtr: Ptr; dataSize: Size): OSErr;
theAppleEvent

The Apple event to which to add an attribute.
theAEKeyword
The keyword for the attribute to be added.
TYPE AEKeyword = PACKED ARRAY[1..4] OF Char;
The keyword can be any of the constants listed in the description that follows. If the Apple event already included an attribute with this keyword, the attribute is replaced.
typeCode
The descriptor type for the attribute.
dataPtr
A pointer to the buffer containing the data to be assigned to the attribute.
dataSize
The length, in bytes, of the data to be assigned to the attribute.
DESCRIPTION
The AEPutAttributePtr function adds the specified pointer to data, descriptor type, and keyword to the specified Apple event as an attribute. You can specify the parameter theAEKeyWord using any of the following constants:

CONST
   keyAddressAttr          = 'addr'; {address of target }
                                     { application}
   keyEventClassAttr       = 'evcl'; {event class}
   keyEventIDAttr          = 'evid'; {event ID}
   keyEventSourceAttr      = 'esrc'; {source application}
   keyInteractLevelAttr    = 'inte'; {settings to allow the }
                                     { Apple Event Manager to }
                                     { bring server application }
                                     { to the foreground}

   keyMissedKeywordAttr    = 'miss'; {first required parameter }
                                     { remaining in Apple event}
   keyOptionalKeywordAttr  = 'optk'; {list of optional }
                                     { parameters for Apple }
                                     { event}
   keyOriginalAddressAttr  = 'from'; {address of original source }
                                     { of Apple event} 
   keyReturnIDAttr         = 'rtid'; {return ID for reply Apple }
                                     { event}
   keyTimeoutAttr          = 'timo'; {length of time in ticks }
                                     { that client will wait }
                                     { for reply or result from } 
                                     { the server}
   keyTransactionIDAttr    = 'tran'; {transaction ID identifying }
                                     { a series of Apple events}
RESULT CODES
noErr0No error
memFullErr-108Not enough room in heap zone
errAECoercionFail-1700Data could not be coerced to the requested descriptor type
errAENotAEDesc-1704Not a valid descriptor record

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996