Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!well!odawa From: odawa@well.UUCP (Michael Odawa) Newsgroups: comp.sys.mac.programmer Subject: Re: Screen vs. Printing Message-ID: <15947@well.UUCP> Date: 3 Feb 90 18:44:36 GMT References: <456@dino.cs.iastate.edu> Reply-To: odawa@well.UUCP (Michael Odawa) Organization: Simple Software, Mill Valley, CA Lines: 21 In article <456@dino.cs.iastate.edu> jwright@cs.iastate.edu (Jim Wright) writes: > I'm afraid I have a bug in a program in a printing routine...I want to > generate information a few pages at a time, and have (modal) dialogs come > up between page groups...I put in SetPort() calls as I switched around, and > all seemed to work well. Then I added an abort option, and very occasionally > the program hangs when quitting. Problems from aborting print jobs are almost always caused by unbalanced prOpenDoc()--prCloseDoc(), prOpenPage()--prClosePage() pairs. Whenever you call the first of a pair, you MUST call the last, or you're SOL. From the sound of the problem, you might check to make sure the Abort procedure closed up all your open--close pairs properly. Also, the PrintMgr probably expects to be set to the printing port when you call these, so make sure that your SetPort()s always put you back into the pPrPort for aborting. Good luck. Michael Odawa Simple Software odawa@well.sf.ca.us