|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Capture cmd line traffic for windows applicationI 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. Thompson_38,
I think this is the exact answer to what you are trying to do. http://radio.weblogs.com/0111551/stories/2002/10/11/runASecondConsoleAppAndReadItsOutput.html -- Show quotei***@dowhileloop.com http://dowhileloop.com website development http://publicjoe.dowhileloop.com -- C# Tutorials "thompson_38" <thompson***@hotmail.com> wrote in message news:1111784964.474075.303520@z14g2000cwz.googlegroups.com... > 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. > "Landi" <i***@dowhileloop.com> wrote in message The sample in the link only works if you start the console application from news:eHjCaQbMFHA.244@TK2MSFTNGP12.phx.gbl... > Thompson_38, > I think this is the exact answer to what you are trying to do. > http://radio.weblogs.com/0111551/stories/2002/10/11/runASecondConsoleAppAndReadItsOutput.html > > -- another C# program, which is not OP's scenario. Willy. Thank you for the information, I had tried the
http://radio.weblogs.com/0111551/stories/2002/10/11/runASecondConsole.... , 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. "thompson_38" <thompson***@hotmail.com> wrote in message I'm not clear on what you mean by 'I don't want to change the console news:1111784964.474075.303520@z14g2000cwz.googlegroups.com... >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. > application', where did you put the StreamWriter, StringWriter ... then? Willy. |
|||||||||||||||||||||||