TPrinterSetupDialog Access Violation

By: CodeGear

Abstract: Workaround for TPrinterSetupDialog Access Violation
When running an application that contains TPrinterSetupDialog on a system that has no printers installed, starting the application may result in an Access Violation. Why does this happen, and how can I stop or prevent it?

Borland Technical Support has not been able to reproduce this error, so the cause remains unknown.

Test for the existence of a default printer using the following or similar code:

if (Printer()->Printers->Count)
// allow the copy
// insert default value here, instead of
// reading the non-existent default printer

Published on: 7/31/2000 12:00:00 AM

Server Response from: ETNASC04

Copyright© 1994 - 2013 Embarcadero Technologies, Inc. All rights reserved.