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 Callback Functions


MyDisposeToken

If your application requires more than a call to the AEDisposeDesc function to dispose of a token, or if it supports marking callback functions, you must provide one token disposal function. A token disposal function disposes of a specified token.

FUNCTION MyDisposeToken (VAR unneededToken: AEDesc): OSErr;
unneededToken
The token to dispose of.
DESCRIPTION
The Apple Event Manager calls your token disposal function whenever it needs to dispose of a token. It also calls your disposal function when your application calls the AEDisposeToken function. If your application does not provide a token disposal function, the Apple Event Manager calls AEDisposeDesc instead.

Your token disposal function must be able to dispose of all of the token types used by your application.

If your application supports marking, a call to MyDisposeToken to dispose of a mark token lets your application know that it can unmark the objects marked with that mark token.

SPECIAL CONSIDERATIONS
If the Apple Event Manager receives the result code errAEEventNotHandled after calling a token disposal function, it attempts to dispose of the token by some other method, such as calling an equivalent system token disposal function if one is available or, if that fails, by calling AEDisposeDesc. Thus, a token disposal function that can't dispose of a token should return errAEEventNotHandled. This allows the Apple Event Manager to try other token disposal functions that may be available.

RESULT CODES
noErr0No error occurred
errAEEventNotHandled-1708The token disposal function is unable to dispose of the token

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996