Random “Printer selected is not valid” errors on Win2K8R2
问题 I recently changed the printing code for automated printing to a TPrinter based solution. (The old solution, writing text directly to the printer network device worked without errors for many years.) The application is written in Delphi 2009 Enterprise and runs continuously in a user session (not as a service). In regular intervals, the application scans a database for new documents, creates the text to be printed, and sends it to a printer. Before printing, the code sets the printer index: