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