home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 14007 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  2.1 KB

  1. Path: sparky!uunet!olivea!hal.com!decwrl!decwrl!world!siegel
  2. From: siegel@world.std.com (Rich Siegel)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: HELP, PLZ:  MPW tool bums out when loading HUGE resource map
  5. Message-ID: <BszL80.I4x@world.std.com>
  6. Date: 14 Aug 92 18:40:47 GMT
  7. References: <COLIN.92Aug14091537@wrangel.Cayman.COM>
  8. Distribution: comp
  9. Organization: GCC Technologies
  10. Lines: 35
  11.  
  12. In article <COLIN.92Aug14091537@wrangel.Cayman.COM> colin@Cayman.COM (Colin "Atilla" Steele) writes:
  13. >
  14. >It works fine, with one small problem.  It pukes on my ".proj" file.
  15. >After some investigation, it looks like the problem is that the
  16. >resource map is too big - the file (map) is 2.5 Mb.  Since MPW tools
  17. >run in a conjured-up C run-time environment, inside MPW, when the tool
  18. >loads the 2.5 Mb resource map, all hell breaks loose.
  19.  
  20.     The file may be big, but that doesn't make the resource map big.
  21. The size of the resource map depends on the number of resources in the
  22. file, not on the size of the resources in the file.
  23.  
  24. >So, my question is: "How do I make this work?"  My first inclination
  25. >is to find some way of getting a handle to 'ckid' # 128 without
  26. >loading the whole resource map.  Is this possible?  Using
  27. >SetResLoad(FALSE) will just cause GetResource() to return NIL, right?
  28.  
  29. Wrong. SetResLoad(FALSE) will suppress loading of resources into memory,
  30. but doesn't inhibit reading of the resource map. Therefore, you can 
  31. SetResLoad(FALSE) before OpenResFile()-ing the resource file, do a 
  32. GetResource() to get an empty handle (i.e. NIL master pointer) to 
  33. your resource, then LoadResource() on that handle. And don't forget
  34. to call SetResLoad(TRUE) when you're done.
  35.  
  36. If the resource file you're opening in fact has lots of preloaded resources
  37. in it, then you are well advised to call SetResLoad(FALSE) before opening
  38. your resource file, but source files only have a few resources in them,
  39. and Projector project databases don't even have resource forks.
  40.  
  41. R.
  42. -- 
  43. -----------------------------------------------------------------------
  44. Rich Siegel                              Internet: siegel@world.std.com
  45. Software Engineer & Toolsmith
  46. GCC Technologies
  47.