M
Marcel
Hi,
I used the following code Jochen Kalmbach suggested to run an external
program:
System:iagnostics:rocessStartInfo *si = new
System:iagnostics:rocessStartInfo();
si->UseShellExecute = false;
si->WorkingDirectory = S"D:\\Promela\\";
si->FileName = "D:\\Promela\\PAN.exe";
si->Arguments = "-a -v";
si->CreateNoWindow = true;
si->RedirectStandardOutput = true;
System:iagnostics:rocess *p =
System:iagnostics:rocess::Start(si);
System::String *output = p->StandardOutput->ReadToEnd();
p->WaitForExit();
System::Windows::Forms::MessageBox::Show(output);
The problem is that the string output is empty, while I know there is
output produced. I think the problem may be that the StandardOutput is
read before the output is produced, though I'm not sure. I tried
switching the oreder of the ReadToEnd() and the WaitForExit line, but
this doesn't help.
Does anyone know how to capture the output correctly?
Thanks in advance,
Marcel
I used the following code Jochen Kalmbach suggested to run an external
program:
System:iagnostics:rocessStartInfo *si = new
System:iagnostics:rocessStartInfo();
si->UseShellExecute = false;
si->WorkingDirectory = S"D:\\Promela\\";
si->FileName = "D:\\Promela\\PAN.exe";
si->Arguments = "-a -v";
si->CreateNoWindow = true;
si->RedirectStandardOutput = true;
System:iagnostics:rocess *p =
System:iagnostics:rocess::Start(si);
System::String *output = p->StandardOutput->ReadToEnd();
p->WaitForExit();
System::Windows::Forms::MessageBox::Show(output);
The problem is that the string output is empty, while I know there is
output produced. I think the problem may be that the StandardOutput is
read before the output is produced, though I'm not sure. I tried
switching the oreder of the ReadToEnd() and the WaitForExit line, but
this doesn't help.
Does anyone know how to capture the output correctly?
Thanks in advance,
Marcel