PDA

View Full Version : Delphi 6 GetPrinter VCL method call seems to be faulty


AlterEgo
03-11-2002, 12:20 AM
I seem to have found a bug in the Delphi 6 VCL with regards the Printer unit.

If I call the Printer.GetPrinter method with all of the appropriate parameters I just get an exception error all the time.

I have stepped right into the VCL code and it looks as if something isn't being initialised in the correct order.

As far as I can tell the global Printer object is instantiated the first time it's called, and when the GetPrinter method is called the .Printers property is populated with a list of printer names and objects. These are then supposed to be used by GetPrinter to retrieve the information I need, but somewhere something in the heirachy is coming back invalid.

I can't see that I should be instantiating or initialising anything else, should I ?

Also, all of the other properties (.PrinterIndex etc.) seem to return valid values when referenced.

Can someone please tell me if I'm correct or if I'm missing something obvious and if so how I can fix this problem.

Thanks in advance

Allan

HTML
03-11-2002, 09:58 AM
Hello :)

Ive used GetPrinter with win98se, never encountered that excpetion error you receive.

Have you tried searching google.com newsgroups , maybe someone else had the same problem?