Output from exe

Hi,

I have this code attached to a button as a test. It’s designed to call a query program that will return null or one or more numbers separated by CRLF. I need to see what is returned. I’ve tried

processstartinfo.set_RedirectStandardOutput(true);
res = process.get_StandardOutput();

but this seems to hang. Also I’m not sure what type res should be.

Any more experienced X++ programmers out there who can help?

void clicked()
{
char res[];
boolean bool;
System.Diagnostics.ProcessStartInfo processstartInfo = new
System.Diagnostics.ProcessStartInfo();
System.Diagnostics.Process process = new
System.Diagnostics.Process();super();
processstartInfo.set_FileName(“c:\versionone\dbarchive\myquery.exe”);
processstartInfo.set_Arguments("-s accpac -o 31417 -u system -p Passw0rd -d Dynamics_Purchase_Invoices -g recid -c EQ -v “+strfmt(”%1",vendtrans.recid));
processstartinfo.set_UseShellExecute(true);
processstartinfo.set_CreateNoWindow(true);
process.set_StartInfo(processstartinfo);

try
{
bool=process.Start();
process.WaitForExit();
res = process.get_StandardOutput();
}
catch(exception::Error)
{
info(“oops”);
}