CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2003
    Posts
    6

    shell win32 programm - close it - howto

    hello,

    how i can close a win shell (DOS/Box/Shell) programm automatical?

    now it says "press a key to ......."
    after the programm stops...

  2. #2
    Join Date
    Jan 2003
    Posts
    18
    add the line return 0; to your main method. this only works for console

  3. #3
    Join Date
    Jan 2003
    Posts
    6
    i have in code

    return 0;
    }

    but under win98 + xp there comes the sentence still again at my tests...

  4. #4
    Join Date
    Aug 2002
    Location
    United States
    Posts
    729
    well where are you running the exe from? a DOS prompt? windows explorer? or visual studio itself? VS wont drop out automatically but the other 2 will.

  5. #5
    Join Date
    Jan 2003
    Posts
    6
    in a DOS prompt

  6. #6
    Join Date
    Aug 2002
    Location
    United States
    Posts
    729
    you want it to close the DOS box? or it's simply not dropping out back to the dos prompt? either way it's weird because i dont think you can do the first and the second should just happen for you.

  7. #7
    Join Date
    Jan 2003
    Posts
    6
    yes, just want that the DOS box geht closed automatic.

    normaly i can make like system, exit call, but the problem is the "press the key"..... comes after the programm

  8. #8
    Join Date
    Jun 2002
    Posts
    1,417
    Just a wild-guess, but check you program to see if you have cin.ignore(), which will display that message.

    ... Also, are you starting your program via a batch file and have a pause in the batch file?

  9. #9
    Join Date
    Aug 2002
    Location
    United States
    Posts
    729
    if you type your executable at the DOS prompt your program exits back to it whether or not the "Press any key" message is shown.

    i dont think you're actually doing that based on what you describe so i still dont understand how you are launching your program.

    when your program runs do you type in the filename in DOS or do you double click something from windows?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured