Morning all.
MyApp lets you chose a printer, which is later used as shown in the
following code. Problem is, that one of my specific printers which uses a
COM port does not initialise properly.It is shown correctly on the title bar
from the initialise code below, which is called from Form.activate.
And it will work if I select the printer options and reselect it before
using it. The other LPT printers work a treat, with no need to re-select
them.
What is more confusing is that when I go to select the COM printer again,
after first initialise below, all the parameters are shown correctly in the
printer selection box.
Error code given is 'Printer Selected is not valid'.
Can anyone advise why?
CODE:
procedure TCopyform.UpDateInfo;
begin
  try
  {1st time round, this enters the DEFAULT printer into registry}
    Printer.PrinterIndex := r.ReadInteger('PrintIDX');
  except
  {each time this is read to see if this app uses a specific printer}
    r.WriteInteger('PrintIDX', Printer.PrinterIndex);
  end;
        {always it is shown correctly below}
  Copyform.Caption := Printer.Printers.Strings[Printer.PrinterIndex];
end;

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

Reply via email to