Good afternoon,
When you create an object of the TPrinter class and change the nPrinterIndex parameter, even after you call the Destroy() method,
the nPrinterIndex parameter of the public variable Printer also changes.
This causes the printer selected by default in the print dialog window to be the last printer selected with the TPrinter object.
If after destroying the TPrinter object ( TPrinter:Destroy() ), you also destroy and recreate the public variable Printer ( Printer:Destroy() and Printer:Create() ),
the printer selected the next time you print, returns to be the default.
The question is, when creating an object of class TPrinter, changing its parameters and then destroying it, the instance of the public variable Printer should also be changed?
Thanks,
André Corrêa
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Printer and TPrinter
Re: Printer and TPrinter
André,
most TPrinter propierties are sent to windows print subsystem and printer driver. That's why changing those properties in a TPrinter instance is propagated to others. So, I'm affraid the programmer is responsible of restoring those values after printing.
most TPrinter propierties are sent to windows print subsystem and printer driver. That's why changing those properties in a TPrinter instance is propagated to others. So, I'm affraid the programmer is responsible of restoring those values after printing.