Important: The information in this document is obsolete and should not be used for new development.
MyGetErrorDesc
If you want to find out which descriptor record is responsible for an error that occurs during a call to theAEResolve
function, you can provide an error callback function. An error callback function returns a pointer to an address. The Apple Event Manager uses this address to store the descriptor record it is currently working with if an error occurs during a call toAEResolve
.
FUNCTION MyGetErrorDesc (VAR errDescPtr: DescPtr): OSErr;
errDescPtr
- A pointer to an address.
DESCRIPTION
Your error callback function simply returns an address. Shortly after your application callsAEResolve
, the Apple Event Manager calls your error callback function and writes a null descriptor record to the address returned, overwriting whatever was there previously. If an error occurs during the resolution of the object specifier record, the Apple Event Manager calls your error callback function again and writes the descriptor record--often an object specifier record--to the address returned. IfAEResolve
returns an error during the resolution of an object specifier record, this address contains the descriptor record responsible for the error.Normally you should maintain a single global variable of type
AEDesc
whose address your error callback function returns no matter how many times it is called. Be careful if you use any other method. When recovering from an error, the Apple Event Manager never writes to the address you provide unless it already contains a null descriptor record. Thus, if you don't maintain a single global variable as just described, you should write null descriptor records to any addresses passed by your error callback function that are different from the addresses returned the first time your function is called after a given call toAEResolve
.If the result code returned by the
MyGetErrorDesc
function has a nonzero value, the Apple Event Manager continues to resolve the object specifier record as if it had never called the error callback function.RESULT CODE
noErr 0 No error occurred