[lazarus] IPC question...

Marc Weustink marc.weustink at cuperus.nl
Fri May 2 09:06:23 EDT 2003


+ From: Tom Lisjac [mailto:netdxr at adelphia.net]
+
+ > + With Process1 do
+ > +   Begin
+ > +     CommandLine:='/usr/bin/find /usr';
+ > +     Active:=True;
+ > +   End;
+ > +
+ > + This creates a process... but it allocates zero ram and
+ doesn't execute
+ > + the find command.
+
+ > Ehm, where and how did you create it ?
+
+ I dropped a TProcess component on a blank form along with two buttons...
+ one to initialize CommandLine and set Active true... and the other to
+ set active false.

Ah, I never used TProces as component, I create it in code. Maybe you neer
some options or so.

Example from cmdlinedebugger.pp:

function TCmdLineDebugger.CreateDebugProcess(const AOptions: String):
Boolean;
begin
  if FDbgProcess = nil
  then begin
    FDbgProcess := TProcess.Create(nil);
    FDbgProcess.CommandLine := ExternalDebugger + ' ' + AOptions;
    FDbgProcess.Options:= [poUsePipes, poNoConsole, poStdErrToOutPut];
    FDbgProcess.ShowWindow := swoNone;
    FDbgProcess.Environment:=Environment;
  end;
  if not FDbgProcess.Running
  then begin
    FDbgProcess.Execute;
    WriteLn('[TCmdLineDebugger] Debug PID: ', FDbgProcess.Handle);
  end;
  Result := FDbgProcess.Running;
end;

Marc






More information about the Lazarus mailing list