> > NB There has been no testing other than a run (which produced a nice list
> >   of fonts)... It has no resource protection so if your default printer is 
>incorrect
> >   or a problem occurs during print, things get ugly...
> 
> A while ago I was asked to write a program to print pages of musical
> staves with different sizes, colours, line thicknesses, clefs, key
> signatures, bar lines, etc. It took me a couple of hours, but eventually
> I had it going OK. The user ran it on her machine, and it AV'ed. It
> turns out she didn't have a printer installed on that particular
> machine, and my program was trying to read all sorts of stuff off the
> default printer, which didn't exist... The solution? Check if the
> printers array is empty, and if it is, quit :)

Actually as demonstrated inhouse it is possible to have a printer installed incorrectly
and have some functions cause AVs but not others... EG a lookup into the Printer.Fonts
list caused an AV even though Word could print fine...

For a professional app all resource accesses that can throw an exception should
have their relevent handlers and resource protection blocks...

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to