![]() |
AECallObjectAccessor |
||||
Header: | AEObjects.h | Carbon status: | Supported | |
Invokes the appropriate object accessor function for a specific desired type and container type.
OSErr AECallObjectAccessor ( DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, AEDesc *token );
The type of the Apple event object requested. Some possible values are defined in
A pointer to the token that identifies the container for the desired object. (Token is defined in AEDisposeToken.)
The object class of the container for the desired objects.
The key form that specifies how to find the object within the container. Key form constants are described in
A pointer to the key data that identifies the object within the container. The type of this data is form-specific. That is, formName typically has key data of type typeText.
A pointer to a token. On return, a token specifying the desired object (or objects). Your application should dispose of this token when it is through with it by calling AEDisposeToken.
A result code. AECallObjectAccessor returns any result codes returned by the object accessor function it calls.
If you want your application to do some of the Apple event object resolution normally performed by the AEResolve function, you can use AECallObjectAccessor to invoke an object accessor function. This might be useful, for example, if you have installed an object accessor function using typeWildCard for the AEInstallObjectAccessor functions desiredClass parameter and typeAEList for the containerType parameter. To return a list of tokens for a request like line one of every window the object accessor function can create an empty list, then call AECallObjectAccessor for each requested element, adding tokens for each element to the list one at a time.
The parameters of AECallObjectAccessor are identical to the parameters of an object accessor function, as described in OSLAccessorProcPtr with one exceptionthe Apple Event Manager adds a reference constant parameter each time it calls the object accessor function.
You can also call a specific object accessor function directly through its universal procedure pointer with one of the invoke functions described in Creating, Calling, and Deleting Universal Procedure Pointers.
A Carbon application should not install an object accessor in a system object accessor dispatch table with the goal that the accessor will get called when other applications resolve objectsthis wont necessarily work. See Apple Event Dispatching (to be supplied later) for more information.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)