Suppressing print error dialogs


Walt Halfdime


I have some code that attempts to print a document using Windows API
calls. It works fine. However, if the printer runs out of a paper, I
end up with a dialog popping up on the PC to which the printer is
connected, with a message like 'There was an error found when printing
the document "NAME" to LPT1:. The printer is out of paper. Do you want
to retry or cancel the job?' with 'Retry' and 'Cancel' buttons.

Once this dialog has appeared, all further print requests block and
never get processed until the dialog is manually closed, by clicking
'Cancel'. This isn't practical, as my code is running as part of an
unsupervised server process.

Is there a configuration setting I can set to suppress display of such
dialogs? Is there something I could have programmatically set when
submitting the job?

I've been doing my testing using both a HP LaserJet 4000 and HP
LaserJet 6MP and I get the same results for both.

Any help very much appreciated. Thanks in advance.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question