Why does WINSPOOL GetPrinter show different job counts on differentcomputers?

  • Thread starter Thread starter Lee Gillie
  • Start date Start date
L

Lee Gillie

I am interoping WINSPOOL, and retrieving LEVEL 2 info for each printer
using GetPrinter. On two W2K computers it correctly returns the number
of jobs waiting in the queue for the paused printer, and the paused
status. On two W2003 computers, however, it always shows ZERO JOBS
waiting to print, yet shows the correct paused status.

What is going on ??
 
Lee Gillie said:
I am interoping WINSPOOL, and retrieving LEVEL 2 info for each printer
using GetPrinter. On two W2K computers it correctly returns the number of
jobs waiting in the queue for the paused printer, and the paused status. On
two W2003 computers, however, it always shows ZERO JOBS waiting to print,
yet shows the correct paused status.

I recommend to post the declares and code you are using to get the
information about print jobs.
 
Herfried said:
I recommend to post the declares and code you are using to get the
information about print jobs.

H -

That's a lot of code to post. Can I presume that you feel my
declarations are such that they behave differently on W2003, and there
are not any known variations in W2003 that might instead explain it?

TIA - Lee
 
H -

I tried to get it all in a small test app to show you and it wouldn't
compile in the new project. Hmmmmm... I made the changes to get it to
compile, and now I get consistent results on 2000 and 2003.

There are lots of examples of GetPrinter out there for VB6, but I
couldn't find them for VB.NET

Thanks for getting me pointed in the right direction. It wasn't making
any sense before.

- Lee
 
Nope, I take it back. Must have had something to do with how I was
queueing up test jobs. Today I see 3 and 9 jobs in 2 queues from 2 W2K
systems, but see only 2 and 0 jobs from W2003. It is just squirrely.
 
Ok, I found the need to pass the security descriptor on OpenPrinter.
Without it, the PRINTER_INFO_2 returned was sometimes not complete, and
made no sense when it was wrong.

- Lee
 
Back
Top