home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18724 < prev    next >
Encoding:
Text File  |  1992-11-20  |  2.0 KB  |  61 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!lhc!mcmathmac.nlm.nih.gov!user
  3. From: mcmath@csb1.nlm.nih.gov (Chuck Bus Error Special McMath)
  4. Subject: PostHLEvent limits?
  5. Message-ID: <mcmath-201192142517@mcmathmac.nlm.nih.gov>
  6. Followup-To: comp.sys.mac.programmer
  7. Sender: news@nlm.nih.gov
  8. Organization: MSD
  9. Date: Fri, 20 Nov 92 19:34:15 GMT
  10. Lines: 49
  11.  
  12. I asked about this yesterday, and have updated *my* knowledge base, anyway,
  13. so thought I'd ask again.  I have an app I wrote which uses
  14. PostHighLevelEvent to send messages to another app on the same machine. 
  15. Here's the code:
  16.  
  17.  
  18.         myEvent.what = kHighLevelEvent;
  19.         myEvent.message = (long)'GENL';
  20.         tLong = (long) 'regi';
  21.         BlockMove(&tLong, &myEvent.where, sizeof(tLong));
  22.         
  23.         myOpts = receiverIDisSignature;
  24.         myRecvID = (long)'MEAS';            /* 'Supervisor' is destination */
  25.         
  26.         SysBeep(1);
  27.         bufH = NewHandle(512L);
  28.         HLock(bufH);
  29.         err = PostHighLevelEvent(&myEvent, myRecvID, 0, *bufH, 
  30.                                                     (unsigned long)256, myOpts);
  31.             
  32.         HUnlock(bufH);
  33.         DisposHandle(bufH);
  34.         if (err != noErr)
  35.               Debugger();
  36.  
  37.  
  38. The problem is that when the buffer size is set to greater than 256, the
  39. receiving app NEVER GETS THE EVENT.  That's right, if the
  40. PostHighLevelEvent call is changed to this ...
  41.  
  42.         err = PostHighLevelEvent(&myEvent, myRecvID, 0, *bufH, 
  43.                                                     (unsigned long)257, myOpts);
  44.  
  45.  
  46.  ...then there is no response from the target app.  But if the length is <
  47. 256, all is well, my target app burps out a message back to this guy, etc.
  48.  
  49. Is there any reasonable explanation for this?  IM 6 doesn't hint at any
  50. limits for passing data in this manner.  Did I miss something?  Is this a
  51. real limit on the amount of data that can be passed?  Is my shirttail
  52. untucked?
  53.  
  54. chuck
  55.  
  56.  
  57. |- chuck mcmath - mcmath@csb1.nlm.nih.gov - MSD, Inc. ------------|
  58. |- National Library of Medicine - National Institutes of Health --|
  59. |- Bethesda, MD 20894 - Volunteers to be next baseball commish -- |
  60. |- "Hey batter, hey batter, hey batter, swing" - Anon. -----------|
  61.