home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!waikato.ac.nz!aukuni.ac.nz!russells
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: HELP! INIT and patching probs
- Message-ID: <1992Dec31.015959.19149@ccu1.aukuni.ac.nz>
- From: russells@ccu1.aukuni.ac.nz (Russell Street)
- Date: Thu, 31 Dec 1992 01:59:59 GMT
- References: <C03AHq.9LF@news.cso.uiuc.edu>
- Organization: University of Auckland, New Zealand.
- Lines: 30
-
- cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole) writes:
-
-
- > CreateResFile("\pTempFile");
- > TempRefNum=OpenResFile("\pTempFile");
- > AddResource(RHandle1,'DITL',128,"");
- > SetResAttrs(RHandle1,resSysHeap+resPurgeable);
- > . // a series of AddResource and SetResAttrs calls
- > .
-
- You need to do a WriteResource before you do a SetResAttrs otherwise
- if the resource gets purged the resource manager goes ape and
- generally behaves badly (hence resources that are -4 gig in ResEdit
- etc). It took me ages to find this problem the first time I
- encountered it!
-
- I see in Think Reference that it says AddResource only sets the
- changedResource flag and you should set any other flags _before_
- writing the resource. I believe that TR is wrong here [for purgeable
- resources].
-
- You can also use SetResPurge to make sure the writing of changed
- purged resources happen automatically -- but this is probably NOT a
- good thing to do an INIT.
-
- ---------------------------------------------------------------
- Russell Street (russells@ccu1.aukuni.ac.nz)
- "Now then, Seagoon, what made you join the army?"
- -- "An armed escort and two military police men."
- (The Goons Show, "The Nasty Affair At the Burami Oasis")
-