?
Solved

Job "sent to printer" but still remains in queue

Posted on 2003-02-22
5
Medium Priority
?
776 Views
Last Modified: 2013-12-03
I've written my own unidirectional port monitor for both win9x- and NT-based platforms. It works perfectly on win98, but I have an idiot problem with the NT version.
The port works well, does perfectly what it has to do, but after enddocport function call (i.e. after finishing the printing) the jobs still remain in the printer queue having "sent to printer" status on XP or "printed" status on NT4SP6. (all pages are printed and all bytes are sent).
The job normally has to disappear from printer queue unless "keep printed documents" is checked, hasn't it?!.
More, on system restart, all jobs remained in queued are sent to printer (i.e. print monitor) again! More more, even I delete all of these jobs from queue, they still reappear and are sent to printer again at the next system restart. Has anybody a logical explanation and/or a workaround for this?

0
Comment
Question by:zoltan082098
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 8000038
I don't know what criteria the spooler uses to decide when it can put the boot to a finished job.

BUT... If this behavior only result when your monitoring software is in place, you would have to look very carefully at your own code.  Perhaps there is some handle that you are indavertently leaving open.

So first thing to do is verify if the problem goes away when your software is not in place.  If that is the case, then I'd open the Task manager and watch the number of handles and User object and GDI objects as your monitor processes a job.  There should be as many when  a job is finished as there were when started.

-- Dan
0
 

Author Comment

by:zoltan082098
ID: 8002015
No, unfortunately it may be a wrong direction. That is, usually I'm not constrained to clear everything after the current job, because all of the consecutive jobs may share the same database (handles, user objects, etc, of course I don't mean the effectively sent data). This database is created by OpenPort, freed by ClosePort; on the other hand jobs are bracketed by Startdocport and EndDocPort.
0
 

Author Comment

by:zoltan082098
ID: 8002088
No, unfortunately it may be a wrong direction. That is, usually I'm not constrained to clear everything after the current job, because all of the consecutive jobs may share the same database (handles, user objects, etc, of course I don't mean the effectively sent data). This database is created by OpenPort, freed by ClosePort; on the other hand jobs are bracketed by Startdocport and EndDocPort.
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 1200 total points
ID: 8002121
I know very little about your project or how well you are implementing the port monitor.  So forgive me if this is a stupid question:

The documentation for EndDocPort says:
>> Monitors should call the Win32 SetJob function to inform the spooler that a
>> print job is completed. A port monitor’s EndDocPort routine should call SetJob with
>> the dwCommand parameter set to JOB_CONTROL_SENT_TO_PRINTER.

Are you doing that?

-- Dan
0
 

Author Comment

by:zoltan082098
ID: 8003116
Bingo!
The most stupid thing is that even in win98's DDK says the same...
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question