quick black screen

Started by
14 comments, last by password 17 years, 12 months ago
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?
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.
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,
What's the matter with system("pause")?
I use ist and have no problem. And nowadays is DOS out, why bother about it.
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,
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.
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.
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++;
Careful, Emmanuel. I think someone is posting flames as an AP then logging on and rating down their victims.
He is free to do so [smile]

This topic is closed to new replies.

Advertisement