|
Prev: the point of pointers
Next: hex decimal to decimal
From: rgiuly on 30 Jul 2006 02:03 Hello, Is there a nice way to keep the console window open in Visual Studio 2003 after your application has stopped running? This question has been asked before though I haven't seen a satisfactory answer yet. One way is to start the exe from within a "cmd" box. BUT, if the program is started like this, the debugging isn't quite right. Something like a divide by zero will get you back to Visual Studio, but in a a sort of roundabout way. Even worse, an unhandled exception doesn't jump to the place in the code where the exception happened. Another way is to add something into the program to make it pause, but that's not very good when you ultimately want an application that does not pause after displaying final output. Something like an option that says "don't close the box on exit" would be ideal - but I see no such option. Any help will be appreciated. -Rick
From: Richard Heathfield on 30 Jul 2006 02:32 rgiuly(a)yahoo.com said: > Hello, > > Is there a nice way to keep the console window open in Visual Studio > 2003 after your application has stopped running? Back in the day, Ctrl-F5 (at least, that was the keypress for Visual C++ 2.0 key-bindings - adjust to taste) would run the program outside the debugger, and pause on completion. This worked just fine, up to and including VC6.0. I don't know if it works in later versions, but I see no reason why not. > This question has been asked before though I haven't seen a > satisfactory answer yet. I never had the slightest problem getting VStudio to do this. -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk email: rjh at above domain (but drop the www, obviously)
From: Ulrich Eckhardt on 30 Jul 2006 14:26 rgiuly(a)yahoo.com wrote: > Is there a nice way to keep the console window open in Visual Studio > 2003 after your application has stopped running? This has nothing whatsoever to do with programming in C and C++, please take such questions to a group dedicated to said environment. > Another way is to add something into the program to make it pause, but > that's not very good when you ultimately want an application that does > not pause after displaying final output. IsDebuggerPresent() helps. Further info on a topical newsgroup. > Something like an option that says "don't close the box on exit" would > be ideal - but I see no such option. Oh, if one could only fix that IDE to do this... Uli -- FAQ: http://ma.rtij.nl/acllc-c++.FAQ.html
From: Barry Schwarz on 30 Jul 2006 15:10 On 29 Jul 2006 23:03:28 -0700, rgiuly(a)yahoo.com wrote: >Hello, > >Is there a nice way to keep the console window open in Visual Studio >2003 after your application has stopped running? > >This question has been asked before though I haven't seen a >satisfactory answer yet. > >One way is to start the exe from within a "cmd" box. BUT, if the >program is started like this, the debugging isn't quite right. >Something like a divide by zero will get you back to Visual Studio, but >in a a sort of roundabout way. Even worse, an unhandled exception >doesn't jump to the place in the code where the exception happened. > >Another way is to add something into the program to make it pause, but >that's not very good when you ultimately want an application that does >not pause after displaying final output. > >Something like an option that says "don't close the box on exit" would >be ideal - but I see no such option. > I have not had any problem making sure the stdin buffer was empty and issuing a getchar just prior to the return statement in main. Remove del for email
From: Richard Heathfield on 30 Jul 2006 15:33
Barry Schwarz said: > On 29 Jul 2006 23:03:28 -0700, rgiuly(a)yahoo.com wrote: > >>Hello, >> >>Is there a nice way to keep the console window open in Visual Studio >>2003 after your application has stopped running? >> <snip> > > I have not had any problem making sure the stdin buffer was empty and > issuing a getchar just prior to the return statement in main. But he specifically said he didn't want to do that. And in any case, the OP's requirement is easy to meet in Visual Studio without polluting the program with arbitrary getchar() calls. (See my reply of about 12 hours ago.) -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk email: rjh at above domain (but drop the www, obviously) |