home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 13176 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  2.2 KB

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!wupost!think.com!cayman!colin
  2. From: colin@Cayman.COM (Colin "Atilla" Steele)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: AESend returns bogus error.  Help!
  5. Message-ID: <COLIN.92Jul29165813@wrangel.Cayman.COM>
  6. Date: 29 Jul 92 20:58:13 GMT
  7. Sender: news@cayman.COM
  8. Distribution: comp
  9. Organization: Cayman Systems Inc., Cambridge, MA
  10. Lines: 55
  11. Nntp-Posting-Host: wrangel
  12.  
  13.  
  14. Hello, netters.
  15.  
  16. I'm trying out some Apple Event stuff, and have run into an
  17. interesting problem.  Perhaps some of you mac.gods could shed some
  18. light on it.  Here's the code:
  19.  
  20. {
  21.   OSErr result;
  22.   LocationNameRec theLocation;
  23.   PortInfoRec thePortInfo;
  24.   TargetID myTarget;
  25.   AEAddressDesc theAddressDesc;
  26.   AppleEvent theAppleEvent, theReply;
  27.   
  28.   result = PPCBrowser(0, 0, FALSE, &theLocation, &thePortInfo, 0, 0);
  29.   
  30.   if (result == noErr) {
  31.     BlockMove(&thePortInfo.name, &myTarget.name, sizeof(PPCPortRec));
  32.     result = AECreateDesc(typeTargetID,
  33.                 (Ptr) &myTarget,
  34.                 sizeof(TargetID),
  35.                 &theAddressDesc);
  36.     result = AECreateAppleEvent(kCoreEventClass,
  37.           kAEQuitApplication,
  38.                   &theAddressDesc,
  39.                   kAutoGenerateReturnID,
  40.                   kAnyTransactionID,
  41.                   &theAppleEvent);
  42.     result = AEDisposeDesc(&theAddressDesc);
  43.     result = AESend(&theAppleEvent,
  44.             &theReply,
  45.             kAENoReply,
  46.             kAENormalPriority,
  47.             kNoTimeOut,
  48.             0,
  49.             0);
  50.   }
  51. }
  52.  
  53. The problem is that AESend returns -903.  I looked it up in IM, to no
  54. avail.  On a hunch, I flipped through the chapter on PPC, only to find
  55. a -903 error described as "unable to open port or bad port ref num."
  56. I checked around some more, and found that the PortInfoRec had a 0x01
  57. in authRequired.  So, what am I to do?  Do I have to get
  58. authentication and open the port myself?  I thought that w/ Apple
  59. Events, you didn't have to muck around in the PPC stuff.  Any ideas?
  60.  
  61. Email replies, and I'll post a summary.  Thanx, in advance.
  62. --
  63.  
  64.  
  65. ------------------------------------------------------------------------------
  66.  Colin Steele     | Cayman Systems, 26 Landsdowne St., Cambridge, MA 02139
  67.  colin@cayman.com | (617) 494-1916 x209 | applelink D0523 | Fax (617) 494-9270
  68.