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 6 - Resolving and Creating Object Specifier Records / Reference to Resolving and Creating Object Specifier Records
Application-Defined Routines / Object Accessor Functions


MyObjectAccessor

Object accessor functions locate Apple event objects of a specified object class in a container identified by a token of a specified descriptor type.

FUNCTION MyObjectAccessor (desiredClass: DescType; 
                           containerToken: AEDesc; 
                           containerClass: DescType; 
                           keyForm: DescType; keyData: AEDesc; 
                           VAR theToken: AEDesc; 
                           theRefcon: LongInt): OSErr;
desiredClass
The object class of the desired Apple event objects.
containerToken
A token that specifies the container of the desired Apple event objects.
containerClass
The object class of the container.
keyForm
The key form specified by the object specifier record being resolved.
keyData
The key data specified by the object specifier record being resolved.
theToken
The token returned by the MyObjectAccessor function.
theRefcon
A reference constant that the Apple Event Manager passes to the object accessor function each time it is called.
DESCRIPTION
Each object accessor function provided by your application should either find elements of a specified object class or find properties of an Apple event object. The AEResolve function uses the object class ID of the specified Apple event object and the descriptor type of the token that identifies the object's container to determine which object accessor function to call. To install an object accessor function either in your application's object accessor dispatch table or in the system object accessor dispatch table, use the AEInstallObjectAccessor function, which is described on page 6-91.

SPECIAL CONSIDERATIONS
If the Apple Event Manager receives the result code errAEEventNotHandled after calling an object accessor function, it attempts to use other methods of locating the requested objects, such as calling an equivalent system object accessor function. Thus, an object accessor function that can't locate a requested object should return errAEEventNotHandled. This allows the Apple Event Manager to try other object accessor functions that may be available.

RESULT CODES
noErr0No error occurred
errAEEventNotHandled-1708The object accessor function is unable to locate the requested Apple event object or objects
SEE ALSO
For information about installing object accessor functions, see "Installing Entries in the Object Accessor Dispatch Tables," which begins on page 6-27.

For information about writing object accessor functions, see "Writing Object Accessor Functions," which begins on page 6-34.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996