[comp.sys.mac.programmer] When does OpenPicture return NIL

ch@maths.tcd.ie (Charles Bryant) (11/11/88)

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.