home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21093 < prev    next >
Encoding:
Text File  |  1993-01-09  |  1.7 KB  |  51 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
  3. From: d88-jwa@dront.nada.kth.se (Jon WΣtte)
  4. Subject: Re: What to do if I can't honor an Apple event?
  5. Message-ID: <1993Jan9.224019.20660@kth.se>
  6. Sender: usenet@kth.se (Usenet)
  7. Nntp-Posting-Host: dront.nada.kth.se
  8. Organization: Royal Institute of Technology, Stockholm, Sweden
  9. References: <C0LtEq.FpM@news.udel.edu>
  10. Date: Sat, 9 Jan 1993 22:40:19 GMT
  11. Lines: 38
  12.  
  13. In <C0LtEq.FpM@news.udel.edu> kurisuto@chopin.udel.edu (Sean J. Crist) writes:
  14.  
  15. >I know I'm supposed to send back an error string as illustrated on IM VI
  16. >6-49, but I'm not sure what integer to send back as the result of the
  17. >handler function, since the cause of a failure wasn't an operating system
  18.  
  19. You should send back "aeEventNotHandled" which I believe is
  20. -600-something.
  21.  
  22. >don't have any other error to send back?  Also, is it my responsibility to
  23. >dispose of the event parameters by calling AEDisposDesc, or is that the
  24. >responsibility of the caller if I send back an error code?
  25.  
  26. This is a source of some confusion. AppleEvents are just
  27. really a type code and a handle of data. Descriptors are
  28. the same. If you "add" a descriptor to an AppleEvent, the
  29. data is COPIED into the event, so you have to dispose the
  30. descriptor as well as the event.
  31.  
  32. usually you do something like:
  33.  
  34.     ProcessSerialNumber psn ...
  35.     AEDesc address , event , ...
  36.  
  37.     AECreateDesc ( & address , .... typeProcessSerialNumber , & psn , ... ) ;
  38.     AECreateAppleEvent ( & event , ... & address ... ) ;
  39.     AEDisposeDesc ( & address ) ;
  40.  
  41.     AEPutParamPtr ( ... ) ;
  42.  
  43.     AESend ( ... & event ... ) ;
  44.  
  45.     AEDisposeDesc ( & event ) ;
  46.  
  47. -- 
  48.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  49.  
  50.    NCC-1701
  51.