Similar Threads:
1.Redirecting stdout/stderr on child process to a window
I'm developing a Windows CE 5.0 app using C# and I need to call a child
process and then capture its stdout/stderr into the textbox of a
window. So I'm P/Invoking the CreateProcess() function and the
SetStdioPathW() function. However, it seems that SetStdioPathW() is
intended for redirecting output to a file, not a window. What should I
be using instead?
2.Redirecting sdtin, stdout, stderr from an already running process
I am trying to redirect stdin, stdout, stderr of a process I started
with the win32 call CreateProcessAsUser, since I couldn't find a way
to start a process with .net that used a user name and password and
didn't show any kind of window. The only way I can see to do redirect
the input and output now is to continue to use the win32 API (maybe a
pipe?). Is there a way to do this with .net? Can I get the process
input and output into a stream or something?
3.child process with redirected stdout and stderr
I need to create a child process and read the child's stdout and stderr in
the parent process. This seems to be surprisingly difficult to do in .NET.
The documentation for the System.Diagnostics.Process class talks about
creating separate threads for reading each stream.
Is there an easier way? Has anyone already written a wrapper?
Thanks.
4.can't redirect stdout and stderr in VC++ 7.1
I've just upgraded from VC++ 6.0 to Visual Studio 2003. I've got a bunch of
cout statements in my code for debugging purposes, just to record some info
on what is happening in a UDP socket interface... i.e. stuff I can't readily
look at with the debugger without perturbing the results. Now for my
problem...
In 6.0, I just put the argument " > log.txt" on the in the program argument
field and my output was redirected to the log file with no problems.
In 7.1, I've followed the directions specified in the help, which say to put
"> filename", without the quotes, in the command arguments in the debugging
section of the property page. Nothing happens. I don't get a log file.
I found one reference in the Knowledge Data Base to there being a problem
with this in Windows NT 4.0, but I'm running XP, and I just made sure I've
got all the Service Packs downloaded and the latest .Net bugfixes installed.
This seems like such a simple thing? Any ideas what I might be missing?
Thanks,
Anne
5.How to get stdout/stderr from unmanaged DLL?
I have setup Console redirection within my Console app (via Console.SetOut
and Console.SetErrror) to route console WriteLine calls to a logfile. This
works just fine with one exception...
I use PInvoke to call into several unmanaged DLLs which write diagnostic
information out to stdout (and possibly stderr). When I run in a
"standalone" mode with no redirection, these DLLs do generate output to the
console window. But I want to run in a "batch" mode where the app is
launched without a window. In this mode I still get all Console.WriteLine
and Console.Error.WriteLine output properly redirected, but lose all output
from the unmanaged DLLs.
Is there anything I can do to get output from an unmanaged, PInvoke'd DLL to
get redirected properly?
Thanks!
-- Tom
6. Capturing spawned child process's STDOUT & STDERR
7. Redirect stdout from unmanaged DLL
8. Windows CE + C# : How to redirect stdout/stderr of child process?