3

Right now, I want to develop a simple application, so I decided that the fastest way to code would be C#.NET, but right now, I'm having a hard time to implement one of the features I need.

What I'm trying to do, is to run a C/C++ console application inside the window of my C# application, like in Unreal Frontend with the little addition of to way communication, so that I can give the console application input for scanf() and std::sin. And what control should I user to display and get the data?

Can anyone point me into the right direction?

1 Answer 1

7

Start the C++ process using the Process class, and use Process.StandardOutput and Process.StandardInput to pass data back and forth.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi,did this work? as I have used this method and it does not work
Did the output from the C++ exe show in the C# solution (i.e. in a panel). I ask as I have used this example, got it to run, but the output from the C++ console is not showing in the C# application. This works fine with a regular C# exe.
@Funky: You have to have a way to redirect from the stream to the panel. This is doable, but a bit tricky, as there's no events on stream. It's definitely possible - look at the Output window in Visual Studio - that's how it's done ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.