Path: utzoo!attcan!uunet!mcvax!ukc!icdoc!qmc-cs!jeremyr From: jeremyr@cs.qmc.ac.uk (Jeremy Roussak) Newsgroups: comp.sys.mac.programmer Subject: ResErrProc (again) Message-ID: <1191@sequent.cs.qmc.ac.uk> Date: 22 Aug 89 09:45:14 GMT Reply-To: jeremyr@cs.qmc.ac.uk (Jeremy Roussak) Organization: CS Dept, Queen Mary College, University of London, UK. Lines: 32 I had only one response to my last posting asking for help on this topic and he (thanks, Ari) suggested posting the code as well, so here goes: I am trying to use the ResErrProc global. IM states that you can put a routine address into ResErrProc which will be called (by ResError?) if ResError is about to return a non-zero code. I use the following code: pascal void ResourceError() { int error; asm { move.w d0, error } /* error code is in d0 */ /* code here to open a window and draw some strings into it, including the error code. No access to resources, etc */ ExitToShell(); } main() { ResErrProc = ResourceError; /* seems immediately to go into ResourceError */ ... } When resourceError is entered, a5 seems to be garbage. It opens the window, draws garbage on the screen and crashes. LSC (3.0) is left complaining "out of memory" when I try to do anything else, and quitting from LSC and trying to restart it gives me the message that the project file is already open. H E L P!! Jeremy Roussak