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 / Installing Entries in the Object Accessor Dispatch Tables


Installing Object Accessor Functions That Find Properties

The Apple event object to which a property belongs is that property's container. You should add entries to your application's object accessor dispatch table that specify object accessor functions for finding properties in containers identified by tokens of various descriptor types. Object specifier records do not specify a property's specific object class; instead, they specify the constant cProperty as the class ID for any property. Similarly, you should specify the constant cProperty as the object class for an object accessor function that can find any property of a container identified by a token of a given descriptor type. If you need to install different object accessor routines for finding properties of Apple event objects that belong to different object classes, you must use different descriptor types for the tokens that represent those Apple event objects.

For example, to specify an object accessor function that locates properties of Apple event objects identified by tokens of descriptor type typeMyToken, you can add a single entry to the object accessor dispatch table:

myErr := AEInstallObjectAccessor(cProperty, typeMyToken,
                                 @MyFindPropertyObjectAccessor,
                                 0, FALSE);
IF myErr <> noErr THEN DoError(myErr);
The code in this example adds an object accessor function to the application's object accessor dispatch table that can find any property of any container identified by a token of descriptor type typeMyToken. If the second parameter were specified as typeWildCard, the MyFindPropertyObjectAccessor function would have to be capable of finding any property of any Apple event object in your application except for those found by handlers with more specific entries in the object accessor dispatch table.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996