Capture cmd line traffic for windows application

T

thompson_38

I have a COM object that wraps a console application. This console app
outputs strings, using tprintf statements, throughout execution. I
would like to capture that output from the console app and display it
in my C# Windows.Forms test application. I have tried StreamWriter,
StringWriter, OpenStandardOutput, but I only get empty strings
returned. I do not want to change the console application nor the COM
app. I am still investigating, and if I find the answer I will be sure
to post it. Thanks for your help in advance.
 
W

Willy Denoyette [MVP]

thompson_38 said:
I have a COM object that wraps a console application. This console app
outputs strings, using tprintf statements, throughout execution. I
would like to capture that output from the console app and display it
in my C# Windows.Forms test application. I have tried StreamWriter,
StringWriter, OpenStandardOutput, but I only get empty strings
returned. I do not want to change the console application nor the COM
app. I am still investigating, and if I find the answer I will be sure
to post it. Thanks for your help in advance.

I'm not clear on what you mean by 'I don't want to change the console
application', where did you put the StreamWriter, StringWriter ... then?

Willy.
 
T

thompson_38

Thank you for the information, I had tried the
http://radio.weblogs.com/01115­51/stories/2002/10/11/runASeco­ndConsole....
, but the exe is not being called directly. I am sorry for the lack of
information, this is a C# windows test application the instantiates the
COM object. The COM object is a wrapper for the C++ console
application. The StreamWriter, StringWriter are being used in the
Test applications, not in either the COM object nor the C++ console
application.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top