I know you can redirect program output to a file, but can it be redirected into a program? I want to display a program's output in an edit control while the program is running.
Printable View
I know you can redirect program output to a file, but can it be redirected into a program? I want to display a program's output in an edit control while the program is running.
So I guess I would just read from the pipe at regular intervals and update it that way, is that right?
Another question. Would it be feasible to create another thread to monitor the pipe at all times? The thread could post a message to the main thread when new data is received. Would that improve performance at all?
>So I guess I would just read from the pipe at regular intervals and update it that way, is that right?
Pretty much. A pipe is treated in much the same way as any other stream.
>Would that improve performance at all?
Possibly, but I don't see too much gain for the work involved unless the command invoked by the pipe uses processor intensive computations or takes user input and the program using the pipe needs to do other work while the command is running.
Thanks, I'm working through it as we speak.