home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!wupost!think.com!cayman!colin
- From: colin@Cayman.COM (Colin "Atilla" Steele)
- Newsgroups: comp.sys.mac.programmer
- Subject: AESend returns bogus error. Help!
- Message-ID: <COLIN.92Jul29165813@wrangel.Cayman.COM>
- Date: 29 Jul 92 20:58:13 GMT
- Sender: news@cayman.COM
- Distribution: comp
- Organization: Cayman Systems Inc., Cambridge, MA
- Lines: 55
- Nntp-Posting-Host: wrangel
-
-
- Hello, netters.
-
- I'm trying out some Apple Event stuff, and have run into an
- interesting problem. Perhaps some of you mac.gods could shed some
- light on it. Here's the code:
-
- {
- OSErr result;
- LocationNameRec theLocation;
- PortInfoRec thePortInfo;
- TargetID myTarget;
- AEAddressDesc theAddressDesc;
- AppleEvent theAppleEvent, theReply;
-
- result = PPCBrowser(0, 0, FALSE, &theLocation, &thePortInfo, 0, 0);
-
- if (result == noErr) {
- BlockMove(&thePortInfo.name, &myTarget.name, sizeof(PPCPortRec));
- result = AECreateDesc(typeTargetID,
- (Ptr) &myTarget,
- sizeof(TargetID),
- &theAddressDesc);
- result = AECreateAppleEvent(kCoreEventClass,
- kAEQuitApplication,
- &theAddressDesc,
- kAutoGenerateReturnID,
- kAnyTransactionID,
- &theAppleEvent);
- result = AEDisposeDesc(&theAddressDesc);
- result = AESend(&theAppleEvent,
- &theReply,
- kAENoReply,
- kAENormalPriority,
- kNoTimeOut,
- 0,
- 0);
- }
- }
-
- The problem is that AESend returns -903. I looked it up in IM, to no
- avail. On a hunch, I flipped through the chapter on PPC, only to find
- a -903 error described as "unable to open port or bad port ref num."
- I checked around some more, and found that the PortInfoRec had a 0x01
- in authRequired. So, what am I to do? Do I have to get
- authentication and open the port myself? I thought that w/ Apple
- Events, you didn't have to muck around in the PPC stuff. Any ideas?
-
- Email replies, and I'll post a summary. Thanx, in advance.
- --
-
-
- ------------------------------------------------------------------------------
- Colin Steele | Cayman Systems, 26 Landsdowne St., Cambridge, MA 02139
- colin@cayman.com | (617) 494-1916 x209 | applelink D0523 | Fax (617) 494-9270
-