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

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!wupost!darwin.sura.net!lhc!mcmathmac.nlm.nih.gov!user
  3. From: mcmath@csb1.nlm.nih.gov (Chuck Expansion Draft Fodder McMath)
  4. Subject: PostHighLevelEvent buffer limit?
  5. Message-ID: <mcmath-191192151434@mcmathmac.nlm.nih.gov>
  6. Followup-To: comp.sys.mac.programmer
  7. Sender: news@nlm.nih.gov
  8. Organization: MSD
  9. Date: Thu, 19 Nov 92 20:25:57 GMT
  10. Lines: 46
  11.  
  12. I'm having a small problem which surfaced just recently.  I have two Mac
  13. applications (both of which I wrote) which pass data back and forth using
  14. high level events.  The code was written a few months ago and tested out
  15. ok.
  16.  
  17. The problem is that I just changed the initial write to send out a rather
  18. large bufferful of data (actually only about 4K).  Here are the two calls:
  19.  
  20. Exhibit A:
  21.       err = PostHighLevelEvent(theMsgEvent, (unsigned long)&itsPSN, 0,
  22.                    (Ptr)&buffer, bufSize, theOptions);
  23.  
  24. Exhibit B:
  25.    err = PostHighLevelEvent(theMsgEvent, (unsigned long)&itsPSN, 0,
  26.                    nil, 0, theOptions);
  27.     
  28.  
  29. Exhibit B works fine.  The recipient does get the event, and all is well. 
  30. Exhibit A, however, is another story.  The recipient NEVER GETS the event,
  31. and the error returned from this call is zero.  Both bufSize and theOptions
  32. are declared as longs.
  33.  
  34. I decided to try something different:
  35.  
  36. Exhibit C:
  37.                 err = PostHighLevelEvent(theMsgEvent, (unsigned long)&itsPSN, 0,
  38.                             (Ptr)&buffer, 1L, theOptions);
  39.  
  40. This one works also.  So far, values of 0, 1, and 512 have worked, and a
  41. value of 1024 did not.  Note that the bufSize sent in Exhibit A was
  42. determined by the statement:
  43.       bufSize = sizeof(buffer);
  44.  
  45. I don't know what to do.  IM6 does not reveal any light on this problem I'm
  46. having.  Is there some inherent (unknown to me) buffer size limit on Post
  47. HL Event?  Why would a big buffer size cause the target app to never
  48. receive the event?
  49.  
  50. Running on a IIfx with 32 MB of RAM, MPW 3.2.3, C++ 3.2.4, MacApp 3.0.1
  51.  
  52. chuck
  53.  
  54. |- chuck mcmath - mcmath@csb1.nlm.nih.gov - MSD, Inc. ------------|
  55. |- National Library of Medicine - National Institutes of Health --|
  56. |- Bethesda, MD 20894 - Volunteers to be next baseball commish -- |
  57. |- "Hey batter, hey batter, hey batter, swing" - Anon. -----------|
  58.