I'm calling a c++ project from c# , the process is like this , i enter some numbers in a textbox and when i push a button it calls a c++.exe program and run it with the numbers i've inserted in texbox ,after this return the result in another textbox.
The problem is that i don't know how to modify in cpp I/O code to read from textbox,that's all i need .
public partial class MainForm : Form
const string exePath = "test-min.exe";
void Button1Click(object sender, EventArgs e)
Process p = new Process();
ProcessStartInfo pinfo = new ProcessStartInfo(exePath, textBox1.Text);
pinfo.CreateNoWindow = true;
pinfo.UseShellExecute = false;
pinfo.RedirectStandardOutput = true;
p.StartInfo = pinfo;
if ( !p.HasExited)
textBox2.Text = "error";
textBox2.Text = p.StandardOutput.ReadToEnd();
private void MainForm_Load(object sender, EventArgs e)
This is how i call it and in c++ i used cin/cout in my programs but i know that here i need to change
I moved this thread to C# because the fact that the process you're running is written in C++ is completely irrelevant to the question. I'm not familiar with ProcessStartInfo.RedirectStandardOutput, so I'll defer to others on whether you're using it correctly.
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...