Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateProcess() Bug

Status
Not open for further replies.

urielxvi

Programmer
Jun 24, 2008
3
US
So Program B has a debug txt log, that it writes out too with all the information and errors after it ran. If I double click the exe, the txt log is updated perfectly.

BUT when Program A uses CreateProcess(Program B), Program B runs, and does what it is suppose to do, but it no longer updates the txt log...

Any ideas?

Here is all the create process stuff...

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

PROCESS_INFORMATION processInformation;

// Try to start the process
BOOL result = ::CreateProcess(
L"ProgramB.exe",NULL,NULL,NULL,TRUE, NORMAL_PRIORITY_CLASS,NULL,NULL,
&startupInfo,
&processInformation);

WaitForSingleObject(processInformation.hProcess, INFINITE);
CloseHandle(processInformation.hProcess);
CloseHandle(processInformation.hThread);
 
Solved, found out that since Program A created the process, Program B's log gets dumped to its creator's directory
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top