home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20463 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.7 KB

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