PDA

Click to See Complete Forum and Search --> : this is embarrasing - how to make the dos window STAY


kovan
Oct 4th, 2000, 09:49 AM
this is kinda embarrasing for me, well maybe not
i havent touched c++ in over 6 months
and today i got my laptop (YUMMMMM)
i am cracking away at c++ and on the mission to learn that damn mfc n open"G"
i made a little proggie..
but when i run the program
when the code is done the dos window goes BOOM and dissappears..

ok now to the point
there is a checkbox somewhere in the visual c++ IDE menu
that i check/uncheck so that damn window stays til i press a button
i looked EVERYwhere for it i coudn't find it
anyone know what menu its under?
its something like "console window" with a check mark beside it...

thank you

Sam Finch
Oct 4th, 2000, 10:06 AM
I can't find your checkbox, but I have the same problem, what I do is this, in my main procedure I put this



int main()
{
// /**/ ensures line is uncommented even if it is in a block comment

/**/ int retval;

//Place your code here

/**/ cin >> retval;
/**/ return retval;
}



that way the program waits for me to input a value before ending, and so the window doesn't disapear.

It's not great but it'll do until someone finds your checkbox.

Eman07
May 24th, 2003, 05:46 PM
make sure that u have this as part of ur libary

#include <iostream>
#include <stdlib.h>


put this code where u want the program to wait


system("PAUSE");


GL :eek:

I had the same problem:D

parksie
May 25th, 2003, 04:36 AM
OpenGL rawks. Although I'd say use GLUT not MFC. Actually....check out http://ngl.sourceforge.net for something I've been playing with recently.

CornedBee
May 26th, 2003, 01:52 AM
Try Project Options->Debug, it might be there.

bataeu
May 29th, 2003, 12:14 AM
I like using


cout << "Press any key to continue";

getch();




but you have to include conio.h