Startdocprinter fn returns a invalid spoller id in Windows 7.
-
martes, 14 de agosto de 2012 12:38
In our application we have tool to monitor a print job and show the status to the user for the print. We use the win32 printer api's in print the job and printerchangenotification api to monitor the print job.
The printerchangenotification gives notification for all print jobs and we have to filter the notifications only for our print job using the print spooler id which was returned during startdocprinter fn.
We have found that in windows XP the monitoring works fine. In windows 7 machine, the monitoring of print job fails and this is because the spooler id returned from startdocprinter fn did not match with any of the notification print job's id.
Is there anyting we need to do in cas of Windows 7 OS ?
Todas las respuestas
-
miércoles, 15 de agosto de 2012 6:54Moderador
Hi rohit_a,
Welcome to the MSDN forum.
Based on your description, you have some problem when using Startdocprinter API; it could not do as expectedly in Windows 7. StartDoc is one of GDI Print API, while the XPS Print API is more compatibility for Windows 7. Here is a link for that: http://msdn.microsoft.com/en-us/library/windows/desktop/gg263344(v=vs.85).aspx
Quoted as below:
“When designing a program for Windows 7, you should consider using the XPS Print API to provide the printing functionality because it provides the most compatibility for the future. Programs that must run on Windows Vista and earlier versions of Windows will most likely use the GDI Print API to provide printing functionality. The GDI Print API is also supported in Windows 7, but it is more limited than the XPS Print API.”
So I suggest you print with the XPS Print API, here is a link for how to do it:
http://msdn.microsoft.com/en-us/library/windows/desktop/ff728890(v=vs.85).aspx
I hope my suggestion will help you.
Regards,
Elegentin Xie [MSFT]
MSDN Community Support | Feedback to us
- Marcado como respuesta Elegentin XieMicrosoft Contingent Staff, Moderator martes, 21 de agosto de 2012 10:11
-
martes, 21 de agosto de 2012 10:12Moderador
Hi,
I have marked my reply as answer.
If you disagree, please unmark it, and post your doubt.Regards,
Elegentin Xie [MSFT]
MSDN Community Support | Feedback to us

