Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!well!smoke From: smoke@well.sf.ca.us (Nicholas Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: PostHighLevelEvent from a completion routine? Message-ID: <25732@well.sf.ca.us> Date: 27 Jun 91 16:03:09 GMT References: <23852@shlump.lkg.dec.com> Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 36 In article <23852@shlump.lkg.dec.com> minow@ranger.enet.dec.com (Martin Minow) writes: >However, when >I tried to use PostHighLevelEvent from a completion routine, the function >returned error -903 (noPortErr). How are you specifying PostHighLevelEvent's receiverID? Is it known to be good at the time of posting? >While I can fall back on using shared globals, I'm wondering if there >is any better way for a completion routine to send an "event" to >an application. Hmmm.. the facelessness of your mission shouldn't (per se) cause any problems, unless you're working at the AppleEvent/notifyUser level, in which case you might run into problems. (Speaking of InteractWithUser, has anyone managed to figure out how that works, and if so, would they post an overview? The descriptions of the routines all sound probabilistic: "*If* such action would be in accord with the principle of User Control (never defined), *then* this routine will do X, *otherwise* it might do Y. At any rate, your program shan't regain control.") Back to your situation, Martin: why not post some code? If you do go the shared globals route, you can easily use Gestalt to pass data (or a sysheap data ptr) back and forth between your two jobs. If one of these data is a flag "IncomingMessage," set by the sender when the mutual data is good, polling it in the receiver will build you a special-purpose event manager all of your own. -- --- * --- Nick Jackiw Smoke@well.sf.ca.us | Jackiw@cs.swarthmore.edu Key Curriculum Press, Inc. Applelink:KEY.EDUSOFT | (415) 548-2304 --- * ---