|
Run external app, and return control |
Bruce Fox
Member #7,301
May 2006
|
Hi Guys, I am writting a DOS app in C++ using Allegro. How can I run an external app (testapp.exe) and once I finished with it, have my The problem I have is when I close the testapp I am left with a blank screen - and not my GUI. I know how to do this in QBASIC and VB6 - but not C++ I envoke the testapp with: system("testapp.exe") // Setup // ---------- clipped ----------- if (key[KEY_1]){ Suggestions? Cheers, ========================= |
Kitty Cat
Member #2,815
October 2002
|
DOS doesn't share resources very well (read: at all), so if the other app wants to use graphics or something, you have to shut it down, call the app, then restart it. // Shutdown Allegro allegro_exit(); system("testapp.exe"); // Re-init Allegro (don't forget error checking) allegro_init(); install_timer(); set_gfx_mode(...); install_sound(...); install_keyboard(); install_mouse();
-- |
Bruce Fox
Member #7,301
May 2006
|
Ahh, Ok I'll give it a go ========================= |
Tobias Dammers
Member #2,604
August 2002
|
Is there a reason why you have to use DOS? If there isn't, or if the reason goes by the name of 'djgpp', then consider using mingw. --- |
nonnus29
Member #2,606
August 2002
|
Quote: DOS doesn't share resources very well (read: at all), so if the other app wants to use graphics or something, you have to shut it down, call the app, then restart it. File access is prone to errors as well. The best way to do it under windows is to start a new thread, run the program, and shut down the thread. I found some source code for doing this as it's all winapi calls but I cleverly didn't bookmark it... Edit; I don't think this is what I found, but it's close and it has some links. |
Bruce Fox
Member #7,301
May 2006
|
Thanks for the replies guys. It MUST be DOS in my case Cheers, ========================= |
|