Hi Guys,
I spawn a child process using Createprocess API...this part is working fine but now I want to redirect the stderr output of the child process to a file....How I can do that?
My code snippet :
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset(&pi, 0, sizeof(pi));
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_NORMAL
int res = CreateProcessW(NULL, // Start the Process
PROCESS_PATH.c_str(),
NULL, NULL, NULL, NULL, NULL, NULL, &si,&pi);
if (res) {
// Do something
}
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
Any help would be apprecciate it.
Thank you
I spawn a child process using Createprocess API...this part is working fine but now I want to redirect the stderr output of the child process to a file....How I can do that?
My code snippet :
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset(&pi, 0, sizeof(pi));
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_NORMAL
int res = CreateProcessW(NULL, // Start the Process
PROCESS_PATH.c_str(),
NULL, NULL, NULL, NULL, NULL, NULL, &si,&pi);
if (res) {
// Do something
}
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
Any help would be apprecciate it.
Thank you