Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!cs.tcd.ie!tcdmath!ch From: ch@maths.tcd.ie (Charles Bryant) Newsgroups: comp.sys.mac.programmer Subject: When does OpenPicture return NIL Keywords: OpenPicture Message-ID: <129@maths.tcd.ie> Date: 10 Nov 88 18:48:14 GMT Organization: Maths Dept., Trinity College, Dublin Lines: 21 Under what circumstances does OpenPicture() return 0 (i.e. NIL)? I have a redraw function which creates temporary Pictures and Kills them before returning. This function works except when printing (after PrOpenDoc). I did a lot of tracing with MacsBug and added a lot of checks and finally found that OpenPicture was returning 0. I have not run out of memory, and the rect passed to OpenPicture is valid. I can't think of any other reason why OpenPicture might return 0. Is this an error indication (not mentioned in IM). If I try to use the 'es' command (Exit to shell) from MacsBug after OpenPicture has returned, I get an invalid address trap when Lightspeed starts redrawing its windows. Is this just because the program has stopped between a PrOpenDoc and its PrCloseDoc, or does it indicate that memory has been corrupted? Thanks in advance. [Please mail me any suggestions (instead of posting) - particularly if I've missed something obvious :-] Charles Bryant -- Charles Bryant. Working at Datacode Electronics Ltd.