When your application receives a reply event, either as a return parameter from the sending routine or in a return event handler, it uses Apple Event Manager functions to extract the information it needs from the event. This process is the same as the one described in “Responding to Apple Events.”
Whenever a server application provides an error string parameter in a reply event, it should also provide an error number. However, you can’t count on all server applications to do so. A client application should therefore check for both the keyErrorNumber (for example, see Listing 5-2) and keyErrorString parameters before assuming that no error has occurred.
When your application has finished using the reply Apple event, it should dispose of it by calling the AEDisposeDesc function. The Apple Event Manager takes care of disposing of both the Apple event and the reply Apple event after a server application’s handler returns, but the server is responsible for disposing of any data structures it creates while extracting data from the event.
Last updated: 2007-10-31