Thread: Console VS MS DOS window

  1. #1

    Console VS MS DOS window

    What are the differences between a "Console Application" and a MS-DOS program?

    When I go into Visual C++ and create a Cpp source file and run it, it runs in a window that kind of looks like an MS-DOS window, but when I go to close it, it does not give me the message "Windows cannot automatically shut down this program automatically...Do you wish to terminate the program and lose any unsaved information?"

    However when I run the same program in Borland C++ (5.5 I believe) it runs it in a MS-DOS window and it DOES give me the "Windows cannot automatically shut down this program automatically...Do you wish to terminate the program and lose any unsaved information?"

    Is Visual C++ really running it in a Console window?
    Is Borland C++ really running it in a MS DOS window?
    Is there even a difference?


  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    In windows.......guess what.......they are all console windows.....

    I guess the reason why Borland doesnt shutdown properly is that theres a seperate process running with it that hasnt been closed (Command interpretor, debugger?????...I dont know).......I dont use Borland and I have no experience of your problem so I am just kind of guessing there...but in answer...yes they are all console windows

  3. #3
    Registered User
    Join Date
    Aug 2001
    here's what happens, Both of the execute a MS-DOS window. But my guess as far as the error message is this, Visual C++ opens a window outside the program wich makes it so that WINDOWS is running the DOS window. If you have played an old MS-DOS game and decided to close it without exiting, you will get the same error. Im guessing Borland opens a msdos window INSIDE the borland program or otherwise uses a program to start your program. (Prolly the compiler).

  4. #4
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    but wouldn't both compilers be doing the same thing? since they are both 32 bit, they create VMs for the console windows? the problem would be how windows closes the console.
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  5. #5
    Registered User /\/\ E /\/ @'s Avatar
    Join Date
    Jul 2002

    two types of dos

    well...when you do it with borland and you set the final EXE file to be a DOS can still run from within windows but it will give you that error because you are not exiting the program from within the program. If you try to run that application that gave you the error on a pure DOS computer (or in the real DOS mode ie.Restart in MS-DOS mode), then it would work....However if you tried to run the Visual C++ application on a pure DOS computer ... it wouldn't. It's called an EasyWin application.

    This is all because Windows can usually support DOS Programs. That's how we can play our games (DOS MODE) from within Windows.

    At least I think so.

  6. #6
    it does that so people won't get their computer doesn't screw up. If it is in the middle of loading or saving to a file, and you just close it, it could screw up the file. Or if you are in the middle of calling an interrupt, it could screw up stuff. DOS isn't like Windows, where you got a set of instructions for what to do when you close the program, because DOS wasn't designed for a multitasking environment.

    Borland C++ makes pure DOS applications. If it is 32bit like you said, it probably puts it into protected mode to run it, like DJGPP does. Visual C++ makes a console. Console windows are just Windows programs, but it simultates the DOS environment. Since it's in windows, you don't get the message.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 03:07 PM
  2. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  3. French characters not displaying on MS DOS Window
    By CookieMonster in forum C Programming
    Replies: 21
    Last Post: 04-05-2004, 09:54 AM
  4. retreiving console window text
    By mayhem in forum Windows Programming
    Replies: 2
    Last Post: 09-10-2003, 09:40 PM
  5. The Timing is incorret
    By Drew in forum C++ Programming
    Replies: 5
    Last Post: 08-28-2003, 04:57 PM