Why might a Delphi 7 application exit with “encountered a problem and needs to close” if the user's PC does not have a printer installed?

I received an email containing a bug report generated by MadExcept with the very helpful stacktrace.

I received an email containing a bug report generated by MadExcept with the very helpful stacktrace: exception class : EReadError exception message : Error reading PrinterDialog. Copies: Operation not supported on selected printer. Main thread ($5d4): 0044c0a2 Classes HandleException 0044c258 Classes TReader.

ReadProperty 0044bbf5 Classes TReader. ReadDataInner 0044bbd7 Classes TReader. ReadData 00450675 Classes TComponent.

ReadState 0044ba51 Classes TReader. ReadComponent 0044bc69 Classes TReader. ReadDataInner 0044bba8 Classes TReader.

ReadData 00450675 Classes TComponent. ReadState 004963a5 Controls TControl. ReadState 004998c9 Controls TWinControl.

ReadState 004afcc9 Forms TCustomForm. ReadState 0044c9a9 Classes TReader. ReadRootComponent 00449f42 Classes TStream.

ReadComponent 00446a3b Classes InternalReadComponentRes 00446bc5 Classes InitComponent 00446c56 Classes InitInheritedComponent 004af661 Forms TCustomForm. Create 004518b0 Classes StdWndProc 004b7111 Forms TApplication. CreateForm 006abe32 176 initialization The problem is caused by the fact I had set a number of properties of the TPrinterDialog at design time, such as the flag to print page numbers.

When Delphi tried to create the form and set these properties on a PC with no printer, the error occurs. The solution was to delete the old TPrinterDialog and replace it with a new default TPrinterDialog and set the properties at run time once a new printer was installed.

You could "try except" the crashing statement: Try Statement {Statement...} Except Statement {Statement...} End; delphibasics.co.uk/RTL.asp?Name=Try Further Description of try/except.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions