August 27th, 2003, 06:04 AM
Console app and processes Q
Two Q's, the first concerns a console app I am using to create a process in Visual C++. I use the console app to lauch a windows app. While the windows app is alive, anything that is written to the console wont appear until the windows app (being the created process) is killed off. I need to display data on the command console while the windows app is still alive. How do I do this?? (ie change focus)
Secon Q is, rather than having the familiar "Press any key to continue", what code do I use to just get the console to automatically close once the created process is killed??
Last edited by sallas; August 27th, 2003 at 07:52 AM.
August 27th, 2003, 08:20 AM
First, you can try 'fflush(NULL)' in your windows app from time to time, the OS buffers writes to stdout, or you can try writing to stderr (cout vs cerr in C++).
Second, are you running the program from the IDE by clicking on the exclamation point? If so, there is an automagic trap to give you the chance to look at your output. Try running it directly from the exe created.
August 27th, 2003, 11:35 AM
My friend, you have done well!!!!!!
Firstly, I substituted cout with cerr as sugested, now the dots increment.
Secondly, how embarrising, yes on creating the .exe, the console disapears as I was running within the compiler!
Thankyou very much, now it being 1:30 in the morning I can go to bed and not worry so much!!
Thank you once again!