home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22089 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  1.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!olivea!apple!evans
  2. From: evans@Apple.COM (John Evans)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Keeping a resource file open forever from an INIT
  5. Message-ID: <77450@apple.apple.COM>
  6. Date: 25 Jan 93 01:13:51 GMT
  7. References: <2L9WB4WS@cc.swarthmore.edu>
  8. Organization: Apple Computer Inc, Cupertino, CA
  9. Lines: 28
  10.  
  11. The way I did this years ago (when I wrote Polly MacBeep) was something like
  12. this:
  13.  
  14. 1) open the file you want to keep around
  15. 2) use the TopMapHndl variable to get the resource map of the file
  16. 3) change TopMapHndl to point at the next resource map in the chain
  17.    (usually the resource map of the init)  This eliminates that file
  18.    from the resource chain.
  19. 4) use SysMapHndl to find the resource map of the system.
  20. 5) follow the NextMap links (described on page 129 of IM-1) until
  21.    you find the LAST resource map in the chain.
  22. 6) add your resource map beyond the last map.
  23.  
  24. You may also (before re-adding your map to the resource chain) have to
  25. copy the resource map into the system heap.  (I don't have the code with me.)
  26.  
  27. This should add you to the resource chain, and make you system 7.1
  28. friendly.
  29.  
  30. Good luck.
  31.  
  32. -- 
  33. +========================+===============================================+
  34. | John S. Evans          | These opinions are mine. Apple's opinions are |
  35. | Collaborative Systems  | Apple's.  Any similarity is coincidental.     |
  36. | Apple Computer, Inc    | "They've given you a number, and taken away   |
  37. | evans@apple.com        |  your name."                  -Johnny Rivers  | 
  38. +========================+===============================================+
  39.