Integration with a C++ console app

  • Thread starter Thread starter A.M
  • Start date Start date
A

A.M

Hi,

I have a C++ console application and I need to integrate it with a C#.NET
application.
Could you refer me to a resource or link that shows me what kins of options
do I have to integrate a C# application with a C++ console app?

Thanks,
Alan
 
Hi,

I think that the only way to interact is using the console.
IF you want that the c# app be able to send/receive data with the c++ app
..the c# app has to create the console app by using Process and redirect
both the standard in/out put.

if you only need one way communication you can use also the console by
either reading from it or writting to it.


Cheers,
 
What would be the best way to redirect a console app's input and output?
Just a link to a sample will help.

Thank you for help,
Alan
 
Hi Alan,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to redirect the standard input
and ouput of a console application. If there is any misunderstanding,
please feel free to let me know.

Based on my experience, we can use Process.StandardInput and StandardOutput
property to achieve this. Before we start a process, we set the
ProcessStartInfo.RedirectStandardOutput property to true, so that all the
output will be redirected to Process.StandardOutput. So does input.

You can refer to the following link for more information and it contains
the example you're looking for:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdiagnosticsprocessclassstandardoutputtopic.asp

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top