home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
- From: d88-jwa@dront.nada.kth.se (Jon WΣtte)
- Subject: Re: What to do if I can't honor an Apple event?
- Message-ID: <1993Jan9.224019.20660@kth.se>
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: dront.nada.kth.se
- Organization: Royal Institute of Technology, Stockholm, Sweden
- References: <C0LtEq.FpM@news.udel.edu>
- Date: Sat, 9 Jan 1993 22:40:19 GMT
- Lines: 38
-
- In <C0LtEq.FpM@news.udel.edu> kurisuto@chopin.udel.edu (Sean J. Crist) writes:
-
- >I know I'm supposed to send back an error string as illustrated on IM VI
- >6-49, but I'm not sure what integer to send back as the result of the
- >handler function, since the cause of a failure wasn't an operating system
-
- You should send back "aeEventNotHandled" which I believe is
- -600-something.
-
- >don't have any other error to send back? Also, is it my responsibility to
- >dispose of the event parameters by calling AEDisposDesc, or is that the
- >responsibility of the caller if I send back an error code?
-
- This is a source of some confusion. AppleEvents are just
- really a type code and a handle of data. Descriptors are
- the same. If you "add" a descriptor to an AppleEvent, the
- data is COPIED into the event, so you have to dispose the
- descriptor as well as the event.
-
- usually you do something like:
-
- ProcessSerialNumber psn ...
- AEDesc address , event , ...
-
- AECreateDesc ( & address , .... typeProcessSerialNumber , & psn , ... ) ;
- AECreateAppleEvent ( & event , ... & address ... ) ;
- AEDisposeDesc ( & address ) ;
-
- AEPutParamPtr ( ... ) ;
-
- AESend ( ... & event ... ) ;
-
- AEDisposeDesc ( & event ) ;
-
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
-
- NCC-1701
-