🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.basic.visual.3rdparty
6 messages
6 total messages Started by Giles Thurston Thu, 01 Apr 1999 00:00
VB5 Check if Printer is Online
#30
Author: Giles Thurston
Date: Thu, 01 Apr 1999 00:00
24 lines
1756 bytes
Help!

Does anybody no how to check if a Printer is 'On-Line'?

Before my program sents data to the printer via the Printer Object it needs
to check if the Printer is On-Line.  I am unable to find a way to do this.

The Printer Object doesn't seem to care if the Printer is On-Line or not and
no errors are returned if the Printer is Off-Line.

I am writing an application which prints to a Panasonic KX-P3696 Printer
connected to the local parallel port.  The application is written using VB5
(SP3) and is running on Windows '95.

I have routed through MSDN and all the API Books I can find in search of a
solution but have had no success

Can anybody help??

All information is greatfully received

cheers

GilesT@mentor.co.uk
Re: VB5 Check if Printer is Online
#24
Author: Charles Kincaid
Date: Fri, 02 Apr 1999 00:00
45 lines
2419 bytes
Stop!

You are not supposed to do that. Windows applications write printer data
to the windows print spooler. The spooler takes care of checking the
status of the printer. What if the printer is a network printer? The
INTERNAL drivers for network printing don't even provide a means of
asking for the remote printer status. What if "print to file" is checked?
That driver could only be "not ready" if the disk is full. 

Just pop up a message box reminding the user to put the printer on-line
and print away! 

>Giles Thurston <GilesT@mentor.co.uk> wrote in
><7e073e$t3e$1@uranium.btinternet.com>: 

>Help!
>
>Does anybody no how to check if a Printer is 'On-Line'?
>
>Before my program sents data to the printer via the Printer Object it
>needs to check if the Printer is On-Line.  I am unable to find a way to
>do this. 
>
>The Printer Object doesn't seem to care if the Printer is On-Line or not
>and no errors are returned if the Printer is Off-Line.
>
>I am writing an application which prints to a Panasonic KX-P3696 Printer
>connected to the local parallel port.  The application is written using
>VB5 (SP3) and is running on Windows '95.
>
>I have routed through MSDN and all the API Books I can find in search of
>a solution but have had no success
>
>Can anybody help??
>
>All information is greatfully received
>
>cheers
>
>GilesT@mentor.co.uk
>
>
>
>
>
Re: VB5 Check if Printer is Online
#25
Author: Giles Thurston
Date: Tue, 06 Apr 1999 00:00
32 lines
2424 bytes
I know that normally you wouldn't want ot do this but this application will
be printing files sent to it via a modem.  The PC and Printer in question
has to be able to run automatically without any user input and create
confirmations to be picked up via the Modem at a later date.  If the Printer
is OFF Line then the Confirmation files must relate this so that an engineer
can be sent in to fix the problem (Don't ask, It wasn't my idea!)

Anyway, I repeat there will be no user input to check if the printer on line
and the system must automatically detect this

Anyway solutions would be appreciated

regards

Giles

Charles Kincaid wrote in message
<8D9C9305Fckincaidatkcdotnet@msnews.microsoft.com>...
>Stop!
>
>You are not supposed to do that. Windows applications write printer data
>to the windows print spooler. The spooler takes care of checking the
>status of the printer. What if the printer is a network printer? The
>INTERNAL drivers for network printing don't even provide a means of
>asking for the remote printer status. What if "print to file" is checked?
>That driver could only be "not ready" if the disk is full.
>
>Just pop up a message box reminding the user to put the printer on-line
>and print away!
>
>>Giles Thurston <GilesT@mentor.co.uk> wrote in
>><7e073e$t3e$1@uranium.btinternet.com>:
Re: VB5 Check if Printer is Online
#26
Author: Force9 News
Date: Thu, 08 Apr 1999 00:00
6 lines
1479 bytes
Giles,

You're probably gonna have to use API calls to query the printer manager.
You'll find this kind of information on MSDN which you can npw get free
access to on the WEB (I think it's MSDN.microsoft.com) off the top of my
head!
Re: VB5 Check if Printer is Online
#21
Author: JC
Date: Fri, 09 Apr 1999 00:00
56 lines
3862 bytes
I missed the first part of this thread, but I have been trying to get to
the printer ports (parallel) myself for some time, and they are getting
harder and harder to get to.

I work with a multi-user Point of Sale system, and we need to be able to
detect problems with printers automatically and re-route the printout to
another printer when there is a problem.  I managed to do this by
building my own spooler for serial printers, but with the print manager
taking over things, I cannot get to the parallel printers.  Printing a
line at a time to LPT1 is not even supported in NT anymore, so that's
out.

Yeah, I spent a few days with those API's, but never found one that
could tell (from VB, mind you) that the printer jammed, or went off-line
in the middle of a printout, then let me handle things by re-routing to
the next printer on my user's pre-defined list.  Some crusty old
seasoned programmers have told me that it is impossible.

I have no words of wisdom, but you do have my sympathy - and please do
let me (or the group) know if you find something handy....

JC
Giles Thurston wrote:
> 
> I know that normally you wouldn't want ot do this but this application will
> be printing files sent to it via a modem.  The PC and Printer in question
> has to be able to run automatically without any user input and create
> confirmations to be picked up via the Modem at a later date.  If the Printer
> is OFF Line then the Confirmation files must relate this so that an engineer
> can be sent in to fix the problem (Don't ask, It wasn't my idea!)
> 
> Anyway, I repeat there will be no user input to check if the printer on line
> and the system must automatically detect this
> 
> Anyway solutions would be appreciated
> 
> regards
> 
> Giles
> 
> Charles Kincaid wrote in message
> <8D9C9305Fckincaidatkcdotnet@msnews.microsoft.com>...
> >Stop!
> >
> >You are not supposed to do that. Windows applications write printer data
> >to the windows print spooler. The spooler takes care of checking the
> >status of the printer. What if the printer is a network printer? The
> >INTERNAL drivers for network printing don't even provide a means of
> >asking for the remote printer status. What if "print to file" is checked?
> >That driver could only be "not ready" if the disk is full.
> >
> >Just pop up a message box reminding the user to put the printer on-line
> >and print away!
> >
> >>Giles Thurston <GilesT@mentor.co.uk> wrote in
> >><7e073e$t3e$1@uranium.btinternet.com>:
Re: VB5 Check if Printer is Online
#22
Author: Giles Thurston
Date: Fri, 09 Apr 1999 00:00
56 lines
3671 bytes
Cheers for the response JC.  At least I now know that its not just me being
stupid.

I spend many a brain draining hour trawling through API books etc.  I called
MS and the solutions they gave me didn't work.

Eventually after playing around with MS solutions I was able to get a
workable solution.

I used the enumJobs API call to monitor the status of the first job in the
Printer Queue.  When the dialog box is displayed by Windows saying "There is
a problem with you printer etc" the status of the Job changes to a new
value.  By detecting this change I was able to remove Printing Job from the
Printer Queue using another API (SetJob I think!).

This allows you to detect the majority of problems with a printer with the
exception of one.  If a printer is physically turned off Windows (95
anyway!) doesn't seem to care!  Windows appears to place a job in the
Printer Queue and then delete it immediately with no change in state and no
error reported.  Even if you print a document from Word to a Printer which
is off you get the same Error.  The response from MS on this was ".. well if
Word doesn't catch it you probably won't be able to.."

Anyway that in a nutshell is my solution. Feel free to contact me for
further details.

Any better solutions would be gratefully received

regards

GilesT@mentor.co.uk


JC wrote in message <370D67DE.E3905845@home.com>...
>I missed the first part of this thread, but I have been trying to get to
>the printer ports (parallel) myself for some time, and they are getting
>harder and harder to get to.
>
>I work with a multi-user Point of Sale system, and we need to be able to
>detect problems with printers automatically and re-route the printout to
>another printer when there is a problem.  I managed to do this by
>building my own spooler for serial printers, but with the print manager
>taking over things, I cannot get to the parallel printers.  Printing a
>line at a time to LPT1 is not even supported in NT anymore, so that's
>out.
>
>Yeah, I spent a few days with those API's, but never found one that
>could tell (from VB, mind you) that the printer jammed, or went off-line
>in the middle of a printout, then let me handle things by re-routing to
>the next printer on my user's pre-defined list.  Some crusty old
>seasoned programmers have told me that it is impossible.
>
>I have no words of wisdom, but you do have my sympathy - and please do
>let me (or the group) know if you find something handy....
>
>JC
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads