Press any key to continue...

This is a discussion on Press any key to continue... within the C++ Programming forums, part of the General Programming Boards category; Whenever the console program ends in MSVC++ 6, it always says Press any key to continue. How do I get ...

  1. #1
    Señor Member
    Join Date
    Jan 2002
    Posts
    561

    Press any key to continue...

    Whenever the console program ends in MSVC++ 6, it always says Press any key to continue. How do I get rid of that?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Run the thread from the dos prompt....not Bulid->Execute inside of MSVC

  3. #3
    Señor Member
    Join Date
    Jan 2002
    Posts
    561
    Is there another way? I can't tell the user to "Go open this program in the dos prompt" because most of the users are going to be lazy and/or stupid.

  4. #4
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Unless you're distributing all the source files and getting the users to build, link and execute the program from within their copies of MSVC, it'll be ok.

  5. #5
    Señor Member
    Join Date
    Jan 2002
    Posts
    561
    Isn't there just a simple command to just close the window? If there isn't there really should be.

  6. #6
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    You don't need it, MSVC(the IDE) keeps the window open. Executing the program in any other environment will result in normal behaviour.

  7. #7
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    well you can create an bat file which opens dos prompt fro whic the file is run....

  8. #8
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    If you run the executable directly instead of running it from MSVC++ then it will close automatically when the program ends.

    -Prelude
    My best code is written with the delete key.

  9. #9
    Registered User
    Join Date
    Dec 2001
    Posts
    28
    If your users are lazy enough not to open DOS prompt, then create a ShortCut on the Desktop, or use the Start -> Run command.

    Basically you have to understand that the "Press any key to continue..." prompt is added by the Visual C++ environment, and is not a part of your program. So whenever you run your program individually, this will not be there.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 12:48 PM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 09:00 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21