In Windows XP/Vista , sometimes the copies selected by the FROM USER clause don't work.
Please see the Remarks at http://msdn.microsoft.com/en-us/library ... 85%29.aspx
I've solved the problem managing the copies in my prg but perhaphs you may solve it definitely in PrintDC.c
Hi,
Davide
PrintDC.c - From User - Antonio
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: PrintDC.c - From User - Antonio
Davide,
Do you mean that FWH controls the above automatically ? thanksnCopies
Contains the initial number of copies for the Copies edit control if hDevMode is NULL; otherwise, the dmCopies member of the DEVMODE structure contains the initial value. When PrintDlg returns, nCopies contains the actual number of copies to print. This value depends on whether the application or the printer driver is responsible for printing multiple copies. If the PD_USEDEVMODECOPIESANDCOLLATE flag is set in the Flags member, nCopies is always 1 on return, and the printer driver is responsible for printing multiple copies. If the flag is not set, the application is responsible for printing the number of copies specified by nCopies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag.
Re: PrintDC.c - From User - Antonio
Antonio,
2) The "Choose Printer" dialog box is opened
3) Change the number of copies (in that dialog)
4) Just 1 copy is printed on most cases in Vista
Perhaps those flags should use PD_USEDEVMODECOPIESANDCOLLATE nowadays, and that would fix the problem (but I didn't try it)
Hi,
Davide
1) PRINT oPrn FROM USERAntonio Linares wrote:Do you mean that FWH controls the above automatically ?
2) The "Choose Printer" dialog box is opened
3) Change the number of copies (in that dialog)
4) Just 1 copy is printed on most cases in Vista
In PrintDc.c I see only references to PD_USEDEVMODECOPIESKnown issue on Windows XP/Vista/Windows 7: If PD_RETURNDC is set but PD_USEDEVMODECOPIESANDCOLLATE flag is not set, the PrintDlgEx and PrintDlg functions return incorrect number of copies. To get the correct number of copies, ensure that the calling application always uses PD_USEDEVMODECOPIESANDCOLLATE with PD_RETURNDC.
Code: Select all
pd.Flags = PD_RETURNDC | PD_USEDEVMODECOPIES |
PD_HIDEPRINTTOFILE | PD_NOSELECTION ;
Hi,
Davide
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: PrintDC.c - From User - Antonio
Davide,
many thanks for your feedback
If you are so kind to test your own proposal, it would be great
Thanks,
many thanks for your feedback
If you are so kind to test your own proposal, it would be great
Thanks,
Re: PrintDC.c - From User - Antonio
Antonio,
If you can replicate the problem at your location, I'm pretty confident you can test that change within minutes, otherwise I'll try to do it here as soon as I can replicate it (I applied the fix in the prg long ago. This thread is just because I've seen that remark while searching for other things, and though it might have been useful for others)
Hi,
Davide
I'm not sure if I should change EVERY pd.flags line or only some of them. I though that you may have done a better job, as you know better than me the logic behind Printdc.cAntonio Linares wrote:If you are so kind to test your own proposal, it would be great
If you can replicate the problem at your location, I'm pretty confident you can test that change within minutes, otherwise I'll try to do it here as soon as I can replicate it (I applied the fix in the prg long ago. This thread is just because I've seen that remark while searching for other things, and though it might have been useful for others)
Hi,
Davide