Hi all,

I'm trying to use TAsyncProcess and got into trouble on other widgetsets than GTK2. The code below works fine on Ubuntu 10.04 x64 (GTK2) and openSUSE 11.3 i386 (GTK2), but not on openSUSE 11.3 i386 (QT) or Windows7 i386.

I played around with the options and other properties, but no message were displayed. It seems OnReadData is never fired.

Another thing is, running "fpc" without parameter works. (Other commands I tried "svn up", "make all" don't work)

What I'm doing wrong?


Regards
Ingo



(I know the example isn't perfect, but the message should come up, as it does on GTK2)

uses ..., Process;

...

procedure TForm1.AsyncProcess1ReadData(Sender: TObject);
var s:String;
    b:DWord;
begin
  s:='';
  b:=AsyncProcess1.NumBytesAvailable;
  if b>0 then
  begin
    setlength(s, b);
    AsyncProcess1.Output.Read(s[1], b);
    ShowMessage(s);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  AsyncProcess1.CommandLine:='fpc -iTO';
  AsyncProcess1.Options:=[poUsePipes, poStderrToOutPut];
  AsyncProcess1.ShowWindow:=swoHIDE;
  AsyncProcess1.Execute;
end;


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to