I am writing a port monitor application that also display an custom dialog .
All of the required port monitor functions(StartDocPort, WritePort, etc.) were implemented.
The custom dialog is called on the EndDocPort() port monitor's function.
Depending on the return code from the custom dialog I want to pause the current print job with:
SetJob(hPrinter, JobId, 0, NULL, JOB_CONTROL_PAUSE);
After that I am closing printer, release memory, etc.
The same code is working under Win NT/2000 & XP (the print job remain on the spooler as paused)!
On Win 98/Me the print job appear to be paused (I verifyed by displaying an messageBox right after SetJob - and go to the selected printer window - the current document is paused - the "Document -> Pause" check box is checked) but right after that the print job is automatically deleted by the spooler and I cannot see it anymore!
I there a way to pause a print job programatically from the EndDocPort() function under Win 98 ?
I would like to install a port from code (C++) without the user interface, there's someone that can tell me how to do this?
I tryed with the AddPortEx suggested by Mick; the function return TRUE but does't work with this Print Monitor.
i'am having a problem printing. i'm working on a project to add address and then print them on mailing labels. please help if you can.
1.) the program excepts address ie; name,city and state, zipcode, into an arrary (user defind type)
2.) within the program i select address for a certin zipcode and send them to print to the printer. this works find, my problem is that the formatting of the labels.
3.) when the printing starts and the 1st sheet is finish the paper ejects and starts another sheet, how do i set the printer head position to the location where it was on the first sheet.
4.) i've tried CurrentY and Printer.Print to add the spaces need. Printer.Print works ok but when the new page starts the format is off, i can't get the second page to start printing where the first page start printing on the labels.
thank you very much
here is and example of codes:
dim a(1 to 3) as string
dim b as integer
For b = 1 to 17
On the sheet of labels there are only five (5) labels. after the program prints the first five (5) labels and the next sheet feeds to the printer the formatting is off.
I have a question about the dirport program. When I add a Local Directory Port this port is named after the directory where to store the files. When I do that again, and choose the same directory, no message is given. However, the printerselect screen does not appear.
On another PC, the correct MessageBox is given, stating 'The port cannot be added, there is already a port with that name'. And no printer can be chosen (correctly).
I have debugged the Monitor.cpp fie and I have discovered that the EnumPorts function returns the incorrect result.
However this function is called by loading the spoolss.dll and then use GetAddress to get the address of the function. MSDN states that the EnumPorts function is included in winspool.h
My question is why did you use the EnumPorts function the way you did? It seems that just include WinSpool.h would be an easier way? What could be the disadvantages of changing the way PortExists is implemented?
hi, i got few question to ask about the dirport.dll:
1. how to get the number of print copies for certain print job?
2. is it possible to filter the number of pages write in the ps file? Let say i print 5 pages, is it possible the program only copy the first 3 pages to the ps file and the rest of the pages just discard it?
hi, when i print the web content to the printer, the web content page show "Pause and restarting" status and it unable to generate the ps file, but when i print the other file like microsoft word, it successfully generate the ps file. Any comment on how to fix it?