6

I have a console application that I didn't write. Is there some easy way to read from it? I need to have the input still on the console window, but read what's being displayed.

I care not whether the output displays to the console or not, so long as the input still works.

Nowayz
  • 1,882
  • 4
  • 21
  • 34

2 Answers2

4

Console Application Runner Classes are excellent to control the console application processes and to redirect input and output where required.

SimaWB
  • 9,246
  • 2
  • 41
  • 46
  • This looks promising, i'll check it out. The only problem I've had in the past with using an fstream for the input is that I can't emulate an enter keypress. – Nowayz Aug 20 '10 at 15:46
0

I had a project that is doing the same thing. I have a console application written in VB.Net and I run and capture it's output using my Delphi application. I have successfully achieved this by following this tutorial by Zarko Gajic.

rajeemcariazo
  • 2,476
  • 5
  • 36
  • 62
  • The code at that site is identical to the code in Ervins's answer. It doesn't handle console input, and it only reads output after the child terminates. – Rob Kennedy Aug 20 '10 at 11:21