[Lazarus] Lazarus COM Event on Windows

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Oct 7 22:14:13 CEST 2009


It works if you don't update the caption but rather write the string
to a field or to the console. So one can assume that you cannot update
the LCL from this callback, for whatever reason.

You can build a list of updates to be done and fill it and then unfill
it with a timer.

This code worked for me:

  TForm1 = class(TForm)
    Label1: TLabel;
    Timer1: TTimer;
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { private declarations }
    DccMan: TDccMan;
    StatusStr: string;
    procedure Change(Sender: TObject);
  public
    { public declarations }
  end;

.............

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Label1.Caption := StatusStr;
end;

procedure TForm1.Change(Sender: TObject);
begin
  StatusStr := DccMan.StatusStr;
end;


-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list