Couple things to look for.
In your etm.exe are you ever calling Console.Out.Flush()? This will flush
what is in the buffer to the Stream.
In your application how are you redirecting the standard output?
Process p;
p.StandardOutput.ReadToEnd().
If you are calling ReadToEnd, it will not read it until I think the stream
is closed. ie the etm.exe has exited. You might want to look at some other
methods Read, ReadLine to get better functionality.
The only time you can send information easily to another process is through
the process start info object. You can only pass command arguments to the
exe.
To pass commands to the etm.exe while it is running, you will have to look
into remoting, or some sort of RPC call to send commands to a seperate
process.
So this might have not helped you at all, but hopefully you have more
insight into your problem.
bill
"Ivan Lam" <iv*****@hkem.com> wrote in message
news:77*************************@posting.google.co m...
Hi all,
Thanks for reading my post!!!
I am facing a problem that I cannot redirect StandartOutput and
StandardInput at the same time without closing the executive.
Actually, I have a console application named "etm.exe", I would like
to call it in my .net (VC) application. What I want to do is when the
user type some command in my .net application, I redirect this command
to etm.exe and also redirect the output of "etm.exe" to my .net
application. Also, I need the "etm.exe" not to be closed until I close
my .net application.
I have tried by using "process" class, I can redirect the input and
output. However, the "etm.exe" is closed every time a single command
completed.
Has anyone tried to develop a similar application?
Thanks in advance. Your help is greatly appreicated!!!
Ivan Lam