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