Jump to content
  • Advertisement
Sign in to follow this  
Lanky007

quick black screen

This topic is 4498 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using VC++ 6.0 Professional edition, I can compile and run my program just fine, except when after I compile it in release mode and go to the folder the workspace is in, and double-click the executable it comes up and then just disappears. I think this might have to do with VC's non-distributable thing or something but I don't know. If I run the code from within the workspace environment, it works fine, but the double-clicking the executable will do the quick screen thing. Anyone know why this happens?

Share this post


Link to post
Share on other sites
Advertisement
Well it might be because the program runs really quick and then exits. I am not sure with C++ 6.0 but with mine system("PAUSE"); does the trick and I have heard of getch(); or getchar(); doing the trick.

Share this post


Link to post
Share on other sites
The preffered way of stopping your program before it quits is to put a breakpoint on the very last line of your program.

Never ever use system("PAUSE"); (each time you do so, God kills a kitten. Really). You may use std::cin.get() or any other function that waits for a keypress, but this is a dull solution since you don't expect a console program to wait for a key before it quits: it prevent you from putting this program in a non-interractive batch or command file.

Regards,

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What's the matter with system("pause")?
I use ist and have no problem. And nowadays is DOS out, why bother about it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
What's the matter with system("pause")?
I use ist and have no problem. And nowadays is DOS out, why bother about it.


Well...
1) Did you ever try to use system("PAUSE"); on a Unix system?
2) Do you really understand that you are launching the Windows command intrepreter in order to call its PAUSE instrisic in order to wait for a keypress? What do you expect to get if your user is using another command interpreter like tcsh?
3) Do you remember that you can wait for a keypress using a single line expression in C++? (std::cin.get())
4) If I put a PAUSE.exe in your program directory, I can do whatever I want. Teh cool.

I can still use command line programs to do complex tasks. Saying that command line programs are dead is plain... weird. At least, linux freaks are still considering command line tools as very valuable, and I believe they are right.

Regards,

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
1. Who cares about UNIX/Linux!!! Thats no OS, thats a toy! Have you tried to work with it? It's not possible!

2. Who cares about such things? DOS is old and out of business. Nobody uses it today for serios things.

3. I know enough methods to pause a programm.

4. see 2.

PS: see 1. and a word to linux freaks: Search for another hobby jerks! Linux will never be an OS.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
1. Who cares about UNIX/Linux!!! Thats no OS, thats a toy! Have you tried to work with it? It's not possible!

2. Who cares about such things? DOS is old and out of business. Nobody uses it today for serios things.

3. I know enough methods to pause a programm.

4. see 2.

PS: see 1. and a word to linux freaks: Search for another hobby jerks! Linux will never be an OS.


I was going to respond to this, but then I thought "Really, why bother." Idiot.

[Edit] I'm not too bothered about my rating, but I really cannot believe someone just rated me down for that. Dear, oh dear.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
1. Who cares about UNIX/Linux!!! Thats no OS, thats a toy! Have you tried to work with it? It's not possible!

2. Who cares about such things? DOS is old and out of business. Nobody uses it today for serios things.

3. I know enough methods to pause a programm.

4. see 2.

PS: see 1. and a word to linux freaks: Search for another hobby jerks! Linux will never be an OS.


while (true) you.stupidness++;

Share this post


Link to post
Share on other sites
Careful, Emmanuel. I think someone is posting flames as an AP then logging on and rating down their victims.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!