I need to modify Roland's RunAndWait of_run() from http://www.topwizprogramming.com/freecode_runandwait.html to capture process output
So far no luck :(
Here is the code I added before CreateProcess call:
// open file for writels_outputFileName = "c:\temp\output.log"lul_file = CreateFile(ls_outputFileName, GENERIC_READ_WRITE, &FILE_SHARE_WRITE, 0, CREATE_ALWAYS, 0, 0)If lul_file <> INVALID_HANDLE_VALUE ThensetNull(lstr_si.hStdInput)lstr_si.hStdOutput = lul_filelstr_si.hStdError = lul_file;End If/*Function ulong CreateFile ( &string lpFileName, &ulong dwDesiredAccess, &ulong dwShareMode, &ulong lpSecurityAttributes, &ulong dwCreationDisposition, &ulong dwFlagsAndAttributes, &ulong hTemplateFile &) Library "kernel32.dll" Alias For "CreateFileW"*/
The file gets created but it is empty.
Here is c++ code I found:
https://stackoverflow.com/questions/7018228/how-do-i-redirect-output-to-a-file-with-createprocess
Please advise.
Thank you,
Yuri