ActiveProcess Won't Allow Disable hStdOutput/hStdError Redirect?


I am using JUCE 3.2.0. I have a question realte to the design of ChildProcess::ActiveProcess class. In the constructor of ActiveProcess, it has code looks like below:

STARTUPINFOW startupInfo = { 0 };
startupInfo.cb = sizeof (startupInfo);

startupInfo.hStdOutput = (streamFlags | wantStdOut) != 0 ? writePipe : 0;
startupInfo.hStdError  = (streamFlags | wantStdErr) != 0 ? writePipe : 0;
startupInfo.dwFlags = STARTF_USESTDHANDLES;

It looks to me that highlighted lines does not allow caller to NOT assign writePipe to hStdOutput and hStdError. Is this by design?

BTW, I am using ChildProcessMaster/ChildProcessSlave and not wanting to redirect hStdOutput/hStdError of slave process.




Looks like a stupid typo in that bit of code - fixed now, thanks for the heads-up!

Thanks for quick reply.

Another question is: ChildProcessMaster::launchSlaveProcess calls ChildProcess::start with default value of streamFlags (wantStdOutwantStdErr), which restrict client of ChildProcessMaster to enable/disable input/output pipe redirection.

Not sure if any side effect while adding streamFlags to launchSlaveProcess?

Sorry, don't quite understand what you're asking?

Sorry about that, let me try again.

I am using JUCE 3.2.0 on Windows. I use ChildProcessMaster::launchSlaveProcess to launch a child process to perform 2-way IPC. The problem is, I DO NOT want to change hStdOutput/hStdErr of child process, but current implementation of launchSlaveProcess won't let me do this.

Is it possible to add additional parameter to ChildProcessMaster::launchSlaveProcess to accept streamFlags like ChildProcess::start does?

I've added this now, please update to the lastest tip :)

Thanks for bringing this up!