none
VS 2010 C++ ctrl-F5 RRS feed

  • Question

  • I am making this request on behalf of several C++ programming students. In the past, we have been able to utilize ctrl-F5 (start without debugging) within VS 2005 and 2008 to keep the console window open so that we may view the output. And now, although it is in the menu in VS 2010, neither selecting the menu option or entering ctrl-F5 will keep the console open. Is this a glitch in VS 2010 or is there a new alternate way of keeping this window open?
    Wednesday, September 8, 2010 7:35 PM

Answers

  • OK….here’s the fix that I used:

    In the Configuration Properties>Linker>System>Subsystem ... change setting to “Console (/SUBSYSTEM:CONSOLE)”.

    Apply and OK.

     

    This seems to clear-up the ctrl-F5 issue.

    Tuesday, September 14, 2010 1:22 PM
  • It was not stated explicitly, but here it is: that feature is no longer in Visual Studio 2010. Ctrl-F5 runs the program without the debugger until the program terminates. Of course when the program terminates, the console window is closed. This was the behaviour in VS2005 and prior, I believe.

    The workaround is to teach your students how to do without the VS 2008 behaviour, which kindly kept the console window open.

    One simple way is to simply put a breakpoint right on the return statement in the main() program and run under the debugger.

    Another way is to add

    getch();

    immediately before the return statement in the main() program. You will probably need to add #include <conio.h> to the include list.

     

    Thursday, September 9, 2010 12:09 AM
  • No, but the old way still works great...

    	while(_kbhit()==0);
    
    

    Requires conio.h 

    Wednesday, September 8, 2010 8:47 PM

All replies

  • No, but the old way still works great...

    	while(_kbhit()==0);
    
    

    Requires conio.h 

    Wednesday, September 8, 2010 8:47 PM
  • No, but the old way still works great...

    	while(_kbhit()==0);
    
    
    
    

    Requires conio.h 


    Isn't that a busy wait?  I would at least put a Sleep(1000) in the loop to give other processes a chance.

    In any case, it seems a shame that the 'Start without debugging' behaviour has changed in this retrograde way.


    Answering policy: see profile.
    Wednesday, September 8, 2010 9:59 PM
  • Yup, I miss it, too. However, I'm not sure it's such a big deal to put a breakpoint on the return statement. Why do I hate those extra mouse clicks so much?
    Wednesday, September 8, 2010 10:15 PM
  • The issue is not that we cannot find the option...the issue is that the option is not working...in the drop menu or by using the short-cut.

    I have seen this issue asked in numerous forums. The answer is always mistakenly given as to how to add the selection to the menu. The item IS in the menu. The short-cut IS shown. Neither option works! There are approximately 20 of us students that have obtained VS 2010 Pro though various outlets...and we are unable to get the console to remain open without adding additional coding to the program being worked on.

    Wednesday, September 8, 2010 10:26 PM
  • It was not stated explicitly, but here it is: that feature is no longer in Visual Studio 2010. Ctrl-F5 runs the program without the debugger until the program terminates. Of course when the program terminates, the console window is closed. This was the behaviour in VS2005 and prior, I believe.

    The workaround is to teach your students how to do without the VS 2008 behaviour, which kindly kept the console window open.

    One simple way is to simply put a breakpoint right on the return statement in the main() program and run under the debugger.

    Another way is to add

    getch();

    immediately before the return statement in the main() program. You will probably need to add #include <conio.h> to the include list.

     

    Thursday, September 9, 2010 12:09 AM
  • It was not stated explicitly, but here it is: that feature is no longer in Visual Studio 2010.

    Err.. Still works for me. Is this only for Express editions?

    Thursday, September 9, 2010 12:50 AM
  • The ctrl-F5 feature works just fine for us in both VS2005 Pro and VS2008 Pro. Our concern is that others claim that it works in VS2010, yet none of us are able to get it to work in VS2010 Pro.
    Thursday, September 9, 2010 1:17 AM
  • It was not stated explicitly, but here it is: that feature is no longer in Visual Studio 2010.

    Err.. Still works for me. Is this only for Express editions?


    Well, Lordy, lordy, now it works for me... but only after I reset my configuration settings.
    Thursday, September 9, 2010 1:31 AM
  • Well, Lordy, lordy, now it works for me... but only after I reset my configuration settings.

    Hmm.. I use the General Development Settings configuration; maybe it's related to using the C++ Development Settings configuration or C# Development Settings configuration?

    Thursday, September 9, 2010 1:48 AM
  • I'm now uncertain regarding the sequence of events on my end. I was totally convinced this feature got lost with VS 2010, since it never worked for me.... I chose C++ development settings initially. Then spurred by this thread, I saved my settings, and then reset my configuration to C#, and found that it was working. I then reloaded my old C++ settings. But now I'm witnessing the correct behaviour.

    For fun I'm going to load VS 2010 Express in a virtual machine and see what the behaviour is there. I'll report back.

     

    Thursday, September 9, 2010 1:52 AM
  • OK….here’s the fix that I used:

    In the Configuration Properties>Linker>System>Subsystem ... change setting to “Console (/SUBSYSTEM:CONSOLE)”.

    Apply and OK.

     

    This seems to clear-up the ctrl-F5 issue.

    Tuesday, September 14, 2010 1:22 PM
  • This is it. Thanks!
    Tuesday, March 5, 2013 2:51 PM