Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!helios.ee.lbl.gov!ux1.lbl.gov!osborn From: osborn@ux1.lbl.gov (James R Osborn) Newsgroups: comp.sys.mac.programmer Subject: Re: SAMPLE cdev in C Keywords: cdev, getresource, packages in rom Message-ID: <1855@helios.ee.lbl.gov> Date: 7 Feb 89 08:33:36 GMT References: <1845@helios.ee.lbl.gov> <3646@geaclib.UUCP> Sender: usenet@helios.ee.lbl.gov Reply-To: osborn@ux1.lbl.gov (James R Osborn) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 20 Thank you very much Reid Ellis! You are exactly right. Simply omitting the segment which attempts to load the (now in ROM) resource caused it to function properly. This does however point out a bug in the logic of the example code as printed in IM-V Ch.18. The whole point was to check if there was sufficient memory. When GetResource returned NULL (since the PACK is now in ROM), the cdev should have gracefully aborted and informed the control panel that it had insufficient memory. This would have resulted in a grayed out panel and NOT a crash. Now since comp.sys.mac.sources does not exist WHERE SHOULD I POST THIS SHORT SIMPLE CDEV WRITTEN IN C? Thanks again -- and thanks Tim Maroney for your $0.02 too! James R. Osborn osborn@ux1.lbl.gov Lawrence Berkeley Laboratory