[Lazarus] Reading from an external process

Richard Mace richard.mace at gmail.com
Tue Nov 5 18:41:09 CET 2013

Thanks Sven
I've now switched to a memo and thats worked
On 5 Nov 2013 15:33, "Sven Barth" <pascaldragon at googlemail.com> wrote:

>  Am 05.11.2013 14:48, schrieb Richard Mace:
>  Hi All,
>  I have got the following code from the wiki for creating and reading
> from an external process. Effectively, I want to capture all of the output
> from the process "handle.exe", into a StringList so that I can read it to
> make sure that everything went OK, however, when I run the following code,
> I am getting a "RunError(103) on the line: WriteLn('-- Going to run: ' +
> OurCommand);
>  Any ideas what I'm doing wrong please?
> Is your application (that one which calls handle.exe) compiled as a GUI
> application or not? (check in the project settings) If it is compiled as a
> GUI application then disable the option and recompile. An additional
> console window should now appear when you run the application from within
> Lazarus in which you'll see your output.
> Reason: on Windows the I/O is closed on startup if the application is
> compiled as a GUI program (Delphi compatible)
> Alternatively you could use a Memo. Either you directly use
> YourMemo.Add('...') or if you want to keep using Writeln, I have a unit
> sent somewhere on the mailing list some days ago that allows you to assign
> a memo or edit to a TextFile so that you could use either Writeln(YourFile,
> '...') or you could override "Output" so that you could keep using
> Writeln('...').
> Regards,
> Sven
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131105/a365cfc5/attachment-0003.html>

More information about the Lazarus mailing list