Redirecting standard-output of current process

M

Max Berghammer

Hi !
Is there any way to redirect the standard-outputstream or
standard-errorstream of the currently running process ? I know that i can
spawn a new process and redirect its standard-outputstream or
standard-errorstream, but i need access to the streams of the CURRENT
process as this one interops with a selfmade COM-Server, that uses an old
third-party (compiled!!!) library, that is printing (Error)Messages to
stderr/stdout. Is this possible anyway ?

regards
Max
 
G

garethdjames

take a look at the .Net Process class, there are many methods for
getting hold of the process (you can use the process ID),

Once you have a reference to the process, the process class has the
following properties which will interest you


StandardInput
StandardOutput
StandardError
 
M

Max Berghammer

Yes, i know these properties, but for using these you have to set
RedirectStandardOutput, etc. to true in the processes startup-info. Problem
is, i have no startup-info for my program´s process, as it is started by the
system and not as a child process...
thanx anyway !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top