Advertisement

"Console" or "GUI" ? (Borland V4.52 question)

Started by January 24, 2001 08:45 AM
5 comments, last by El Duderino 24 years ago
When setting up a project in Borland C++ V4.52 I have a choice of two options for "Target Model" if I select Win32 as the platform. These are "Console" and "GUI". What are the implications of both choices, anyone know ? I''d rtfm but I don''t have it and online help isn''t giving it away. El Duderino
Console will run the compiled program as a DOS program, more or less, and it will all be text; GUI gives you a standard Windows32 program.
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza
Advertisement
In a inevitably futile attempt to nip this in the bud before it continues to spread on to further generations...

A console app has absolutely nothing to do with DOS. DOS is dead and gone, forget you every saw those three letters. A console app is a Win32 program just as much as a non-console app is.

A console app typically uses plain text (but doesn''t have to) - printf and such. When you open up a Command Prompt and type dir you are using a console app. A GUI app is like notepad or Word or something that uses a GUI.

-Mike
Ok .. A console app "by default" creates the same type of window that you get when you open a (MS-DOS Window) in Windows95 (or higher) ... this is not really a dos window ... but it is a comand line interface very similar to that which dos had and/or the terminal interface on a unix/linux machine.

A GUI app is what everybody means when they say a "windows" app.

IMPORTANT ... when you choose console ... you create the C/C++ standard main() function ... and the functions printf/scanf and i/o objects cin/cout/cerr are all defined and function as you would expect.

if you choose GUI .. you must create a WinMain() function (and the coresponding windows class and win proc ... sending to stdin/stdout/stderr .. including the c++ cin/cout/cerr .. will have no evect .... because they are not tied to anything.


So .. use console to do things that are "pure" c++ or that require a command line interface ... use GUI to create windows specific apps and user interfaces.

I usually test my units in a console (unless they rely on other thing that a console doesn''t have) before integrating them into my GUI app.
Splendid, thanks so much for these explanations

One mystery sorted out (countless mysteries remaining).

El Duderino
--------------------------------
DOS is dead and gone
--------------------------------

Although a console app is really a window under Windows, I wouldn''t say DOS is dead(not in the OS at least).

--------------------------------
So .. use console to do things that are "pure" c++ or that require a command line interface
--------------------------------

Not under MacOS, where printf actually outputs to a GUI.

Hehe, bizarre facts are fun.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."

The Micro$haft BSOD T-Shirt
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt
Advertisement
>> Not under MacOS, where printf actually outputs to a GUI.

I don''t think that was really relavent to the discussion .. which was about the ''console'' and ''GUI'' project options in Borland C++ 4.52. I certainly didn''t think he meant the meaning of console I use here at work every day which is the control surface of a large post-production mixing console. (said in a light hearted and friendly way).

This topic is closed to new replies.

Advertisement