how to keep console window open

  • Thread starter Thread starter Bumbrlik
  • Start date Start date
B

Bumbrlik

When I spawn a console application from a another
application of mine using
_spawnl(_P_NOWAIT, my_program, ......),
it opens a new console window but when it is finished the
window is automatically closed.

Is there any way I can keep the window open even after the
program terminated (I want to be able check the output) ?

Thank you.
 
Bumbrlik said:
When I spawn a console application from a another
application of mine using
_spawnl(_P_NOWAIT, my_program, ......),
it opens a new console window but when it is finished the
window is automatically closed.

Is there any way I can keep the window open even after the
program terminated (I want to be able check the output) ?

You can allocate the console before executing the app.

Just call "AllocConsole();".
After you checked the output you can call "FreeConsole();"

It works at least for CreateProcess (but should also work for spawn;
because it uses CreateProcess).


--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/useritems/leakfinder.asp
 
Thank you, that works great !!!
-----Original Message-----
output) ?

You can allocate the console before executing the app.

Just call "AllocConsole();".
After you checked the output you can call "FreeConsole();"

It works at least for CreateProcess (but should also work for spawn;
because it uses CreateProcess).


--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/useritems/leakfinder.asp
.
 
Back
Top