Hello,
I have a Delphi 7 (not 2007) application (lets call it App1.exe) that the IDE thinks is a GUI application but in the DPR, a compiler directive that makes it in to a console application. Example:
{$IFDE MAKE_CONSOLE}
{$APPTYPE CONSOLE}
{$ENDIF MAKE_CONSOLE}
During the build process, MAKE_CONSOLE might be defined.
The problem I am having is that we have another console application (say, App2.exe) that runs App1.exe using the WinAPI CreateProcess. When is occurs, the output from App1.exe is nowhere to be seen :-( When App1.exe is ran straight from Commandline (cmd.exe), the output is shown in the Commandline window.
What I am guessing is that I need to redirect output from App1.exe in the CreateProcess, using the STARTUPINFO structure. I am not sure what I am meant to be doing here.
Other info: * 'dwCreationFlags' that are being used are: CREATE_NEW_PROCESS_GROUP + NORMAL_PRIORITY_CLASS + DEBUG_PROCESS (yes, App2 debugs App1)
'bInheritHandles' is false (does this need to be changed?).
Both 'lpProcessAttributes' and 'lpThreadAttributes' are nil, as are 'lpEnvironment' and 'lpCurrentDirectory'.
Have I missed any information that is required to help me out?
Any pointers would be great!
Many thanks in advance, Nick