connecting 2 createprocess - like piping in DOS - how?

From: Bill Mudd (mcmuddjunkno_at_earthlink.net)
Date: 01/25/04


Date: Sat, 24 Jan 2004 17:47:17 -0800

I have 2 console programs that, in DOS, can be "piped"
one into the other -
    prog1 | prog2

How can this be done in windows using createprocess
for each console prog ?

createprocess(prog1, ...)
createprocess(prog2, ...)

create 2 pipes ? or use a Tmemorytream ?
then what ?

I already know how to setup createprocess to run the console
programs. And creating pipes that read/write the console's standard inputs &
outputs is not the same thing. It's use is just to redirect the console
"screen"
outputs for display to say a Tmemo or whatever.
I have already implemeted this part.

It's connecting the output of progr1 to prog2 that I don't
understand how to do. It is above my current knowledge but I'm trying to
learn. If you could provide a simple code example to illustrate the
explanation it would be appreciated.

Thanks,

Bill Mudd



Relevant Pages

  • Re: Screen flash when using cl.exe
    ... PS This problem exists with the Visual C++ .NET 2003 compiler. ... > When Windows starts a subprocess, it will try and attach it to a console ... Then I modified the first application to use CreateProcess ...
    (microsoft.public.dotnet.languages.vc)
  • Screen flash when using cl.exe
    ... same bug exists with Microsoft's cl.exe compiler. ... I request that it be replaced with CreateProcess. ... When Windows starts a subprocess, it will try and attach it to a console unless ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Inconsistent File Access problem
    ... Processes started by CreateProcess always ... 'inherit' the process token of the calling process not the thread token. ... application to be run as a subprocess, which is invoked by an ASP.NET ... these same codes reside in a separate console application, ...
    (microsoft.public.dotnet.security)
  • Re: How to run a program silently with CreateProcessWithLogonW()?
    ... > Well, I did made it when I used CreateProcess, the same setting does not ... > I am working on Windows Server 2003. ... a new console window appears. ... direct or with the comspec? ...
    (microsoft.public.win32.programmer.kernel)
  • CreateProcess and controlling the console
    ... I have a console utility that I want to use from within my Delphi ... So I use CreateProcess to run this utility the standard way, ... it writes an error message to the console just before ... destroys the console right after the utility exits, so I am not able to ...
    (borland.public.delphi.nativeapi)