Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!csd4.milw.wisc.edu!srcsip!manyjars!mnkonar From: mnkonar@manyjars.SRC.Honeywell.COM (Murat N. Konar) Newsgroups: comp.sys.mac.programmer Subject: Re: GetRsrc strange in LSP Message-ID: <24387@srcsip.UUCP> Date: 22 Jun 89 18:07:57 GMT References: <24302@srcsip.UUCP> <32576@apple.Apple.COM> <24329@srcsip.UUCP> Sender: news@src.honeywell.COM Reply-To: mnkonar@src.honeywell.com (Murat N. Konar) Distribution: na Organization: ipd Lines: 33 In article <32576@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes: > >I don't know why you aren't finding your resource, but the fact that the >Resource Manager is returning "noErr" was a deliberate "feature". I honestly >don't know why it does this, but the Resource Manager intentionally doesn't >set ResError to resNotFound if it can't find the resource on a Get(1)Resource >call. To add to the bizarreness of it all, Get(1)NamedResource DOES set >ResError. Egg is on my face. I re-read the Resource Manager chapter in IM and there it was in Black and White. GetResource returns nil if it can't find the requested resource. Thanks to Keith Rollin and Greg Marriott of DTS for their responses. In case some of you out there in the listening audience are interested, here's why I wasn't finding my resource: LSP sets the current resource file to itself (the LSP application) before its "window manager" calls the WDEF with a message of wHit. The solution then is to paste your resource into the LSP application or the System file (not recommended) so that the resource is always available. This method needs only to be used in the LSP environment; compiled applications will run fine with resource in their own file. ____________________________________________________________________ Have a day. :^| Murat N. Konar Honeywell Systems & Research Center, Camden, MN mnkonar@SRC.honeywell.com (internet) {umn-cs,ems,bthpyd}!srcsip!mnkonar(UUCP)