WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Printer Controller

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

pGetPrtInfo Status is always 0


Question:

I think there is a bug with the extender. I've got the code as follows:
MyPrinters = pGetPrtList(0)
NumberofMyPrinters = ItemCount(MyPrinters, @TAB)

For x = 1 To numberofmyprinters
   item = ItemExtract(x, Myprinters, @TAB)
   type = pGetPrtInfo(item, 17)
   Display(20,item, type)
Next
This code displays a message for each installed printer. My problem is the status returned from the pGetPrtInfo is always 0. Interestingly if I go to the printers control panel I can see that the status of one printer is "Printer not found on server, unable to connect". But it still returns 0.. If I try to print to it I get an error right away. Surely the status must be updated?

What do you think?

Answer:

This is not a bug. My understanding is that you can only check the status when the printer is actually trying to print. Otherwise you just get status = 0.

The status of printers and print jobs are updated by the Win32 Spooler during the despool of a print job. At all other times, when that printer is not despooling and reports no state information, the printer is considered to be ready and idle.

Reference:
http://support.microsoft.com/default.aspx?scid=kb;en-us;160129


Article ID:   W16850
File Created: 2007:07:03:14:26:34
Last Updated: 2007:07:03:14:26:34