[comp.sys.mac.programmer] Releasing a network printer after use ?

pascal@CAM.ORG (Pascal Gosselin) (02/01/91)

    I am presently finishing up an custom application that prints out
reports on the ImageWriter LQ in draft mode.  My code looks something
like this...

PrOpen;
PrDrvrOpen;
PrCtlCall(... various ascii flows...);
etc...

PrDrvrClose;
PrClose;

The problem is that once the program terminates, the printer isn't
released (it is an AppleTalk ImageWriter II or LQ).  That is, people
trying to access it afterwards get the "printer busy" until it finally
times out and does a formfeed after a few minutes.

Inside Mac II's printing manager chapter does not mention if (for driver-only
stuff) PrOpen and PrClose even need to be called.  Indeed, my program does still
work without them.  However, this doesn't solve the releasing problem.

Also, after my program has run, the Mac will often freeze up or bomb. This
does not occur within the program, it only occurs after the program has
been Quit....  I am therefore assuming that the improper closure method
is leaving code where it shouldn't be!

All of the user interface code is vanilla Prototyper 2.1 generated for
MPW 3.1.  The app is small, only about 70K in object code.

What I am doing wrong?

Email would be grealty appreciated!


-- 
+----------------------------------------------------------------------------+
| Pascal Gosselin          | Internet: P.Gosselin@CAM.ORG Applelink: CDA0585 |
| Gest-Mac Inc. Apple VAR  |   Voice (514) 767-4444   Fax (514) 767-7337     |
+----------------------------------------------------------------------------+