0

I have two applications: one written in Delphi6 is a main application, other written in C# is a plug-in exe module which outputs its result to console.

Could you provide some example of how to run this plug-in exe with CreateProcess and get it's console output to string or WideString ?

1 Answer 1

1

Creating a Child Process with Redirected Input and Output

Sign up to request clarification or add additional context in comments.

4 Comments

Couldn't get this work. Console window flashes for a moment and then ReadFile in ReadFromPipe waits forever.
I am not very familiar with C# development. Are you sure the C# app uses the standard console output and not some custom output? Please update your question to show the actual code you are using now.
I am pretty sure as I was able to redirect its output to file using command line. I think this is a synchronization problem. The app finishes before I capture its output. BTW: people complain about the same issue in comments to that article.
Even if the client process ends, the pipe will still be open since you have active handles to it, so you can sill read any data the child process wrote to the pipe.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.