If the printer is not completely removed from the system when working with the SRVPrint component,
appears error "There is no default printer currently selected" .
A similar error was described in 2012 (/forums/viewtopic.php?t=5488) - still no changes in the source code.
How to reproduce the error:
- The system should not have printers (disconnect and remove all).
- Create a new printer (for example, Microsoft XPS) on the unused port (LPT1...).
- Create a new VCL – Delphi application and place the SRVPrint component on the form.
- Save the project and close Delphi.
- Print something (for example, a test page) - the job gets into the print queue.
- Remove the printer (it will disappear from the list of printers)
- Start Delphi and open the saved project...Error
Which, in this situation, it returns Printer.Printers.Count = 1
But any references to Printer objects (for example, Printer.PrinterIndex, etc.) - generates an error.
Delphi 2010, XE6