Adding port close delay?

B

bryanfeir

Here's the situation:
* I have a printer which is connected via a virtual COM port
* The print spooler is told to print to this port
* The print spooler performs open/write/flush/close
* The 'flush' part returns success after the local COM port buffers
are
flushed, but before the remote printer buffers are flushed
* As a result, the 'close' causes still-buffered data to be dropped,
cutting off the end of the data being printed.

The ultimate solution is probably to fix the virtual COM port driver
to
properly verify that data is flushed all the way down the line.
However,
the likelihood of getting the ear of the vendor of said driver is low,
especially if they can shift the blame to someone else.

The simpler solution is to figure out some way to put a delay in the
spooler between the 'flush' and 'close'. A little experimentation
shows
that even one second delay should be sufficient. However, I can see
no
obvious way of doing that from the many options on the printer
properties
wizard, and I've tried just about every setting there already. Does
anybody know a registry setting that will cause the spooler to add a
short delay before closing a COM port?

Bryan Feir
 
B

bryanfeir

Of course, the alternate approach is to add junk data to the end so
that the data dropped is not relevant. The 'End Print Job' command
in the Properties box only accepts 49 characters, which is not
enough. So the next question is, is there a way to make the print
separator page print at the end of the print job instead of the
beginning?

Bryan Feir
 

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

Top