Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!well!brecher From: brecher@well.UUCP (Steve Brecher) Newsgroups: comp.sys.mac.programmer Subject: Re: GetResource in DA's Message-ID: <15134@well.UUCP> Date: 21 Dec 89 01:04:40 GMT References: <14956@eerie.acsu.Buffalo.EDU> <9338@hoptoad.uucp> Reply-To: brecher@well.UUCP (Steve Brecher) Organization: Software Supply, Sunnyvale, CA Lines: 23 In article <9338@hoptoad.uucp>tim@hoptoad.UUCP (Tim Maroney) writes: > Break on GetResource in Macsbug, find out the ID you're really looking > for from the stack, then go back into run-time mode and look for the > resource with that id (using ResEdit). This is likely to cause confusion if Suitcase II is used. Suitcase II dynamically assigns unit numbers to DAs, and maps the ID passed to GetResource to the ID in the suitcase (or System) file. So the ID passed to GetResource would typically differ from the ID ResEdit shows. The original query was due to a nil handle returned by GetResource called from a DA's control routine, whereas the call succeeded when called from the open routine. The only two reasons I can think of for this are: (1) different and incorrect calculation of the owned resource ID in the control routine as compared with the Open routine; (2) the call is really failing, due to some error such as insufficient memory. Any such error other than resNotFound would be indicated by a nonzero return from ResError(). -- brecher@well.UUCP (Steve Brecher)