Thread: Windows Console!

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    70

    Question Windows Console!

    Hey,

    i am learning C++, i just wanted to know are the consoe functions (cout, cin, getch...etc) used in windows programs??

    and one more thing. How do i make a console in a windows window. i mean, it's got a console: the main thing in the window + a menu and other stuff. What i mean, is instead of the usual DOS like window, i want a window with a Windows appearance, and a white background! I've seen it done before, so don't tell me i can't do it!

    Please Help.
    (ciao)

  2. #2
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    >> i just wanted to know are the consoe functions (cout, cin, getch...etc) used in windows programs??

    No.

    >> and one more thing. How do i make a console in a windows window.

    Use an edit box which covers the entire window and just create it with no boarder.

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

    Re: Windows Console!

    Originally posted by Perica
    Hey,

    i am learning C++, i just wanted to know are the consoe functions (cout, cin, getch...etc) used in windows programs??
    For console based windows programs - of course!!!! They most likely call console APIs to get the work done, but as long as your compiler implements them properly, yes they are fine

    Originally posted by Perica
    and one more thing. How do i make a console in a windows window. i mean, it's got a console: the main thing in the window + a menu and other stuff. What i mean, is instead of the usual DOS like window, i want a window with a Windows appearance, and a white background! I've seen it done before, so don't tell me i can't do it!

    Please Help.
    (ciao)
    Yup - here

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    This is just about the most basic Windows program you can make, try it out - look up the API functions I call in your help or at MSDN...

    (grumbles - humph - second time today I've posted this - when will people learn to search the board)...
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Registered User
    Join Date
    Sep 2002
    Posts
    70

    Question

    this doesn't help me at all, what does "simplewindow.cpp" do?? it doesn't want to compile in VC++ 6 & i don't have the MSDN library. And what is the point of learning all of these console functions, WHEN you can't use them in Windows programs

    ciao

  6. #6
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    Originally posted by Perica
    this doesn't help me at all, what does "simplewindow.cpp" do?? it doesn't want to compile in VC++ 6 & i don't have the MSDN library. And what is the point of learning all of these console functions, WHEN you can't use them in Windows programs

    ciao
    >> what does "simplewindow.cpp" do??
    It shows you the base of a windows program with no functionality.

    >> it doesn't want to compile in VC++ 6 & i don't have the MSDN library.

    Your VC++ must have serious problems then and the MSDN library is avaliable online here.

    >> And what is the point of learning all of these console functions, WHEN you can't use them in Windows programs <<

    The point of them is to get your console programming done and the point of winapi functions is to get winapi done

  7. #7
    Registered User
    Join Date
    Sep 2002
    Posts
    70
    VC++ returns this error: "Unresolved externals _main"

    And you mean that i am learning all of this so called C++ for console apps, and i bought books and things to learn it. TO TELL ME THAT IS IS USELESS IN WINDOWS PROGRAMS!!!

    AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!

    Please tell me it is not true!!!!!

    is it??

    Help out please.....With the error.

    P.S. What is an MFC Application??

  8. #8
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> VC++ returns this error: "Unresolved externals _main"

    I suspect that is because you told VC to create a Console App rather than a Windows App - change that, it will probably work. All the example I give are written with VC++. As you will learn, mastering VC is as much of a job as mastering C or C++.

    >>>
    And you mean that i am learning all of this so called C++ for console apps,
    <<<

    Console App's are a special sort of Window which looks like a "DOS box". There are a whole bunch of Win32 API routines specifically for console programming. HOWEVER, things like cout, cin, etc. ARE NOT part of Windows programming, or Linux programming or any operating system programming, they are specific to the C, (in this case C++) language. If you cannot use the language properly, you will have trouble programming for any OS. Most books which teah C/C++ on a Windows platform use console apps because a console app is relatively simple - if you look at my code, you will see, you have to jump through a number of hoops to make a Windows program.

    >>> What is an MFC Application??

    All OS's expose an "API", (Applications Programmers Interface). The Win32 functions I call in my code are parts of the Windows API. Some people like calling the API directly - it is, in my opinion, the best way to learn. However, a more object oriented approach is to "wrap" the API functions into a series of classes, and to "bolt together" applications from these. There are several class libraries around. MFC, (Microsoft Foundation Class), is one such library, others include OWL and VCL.

    I would advise you to become proficient at C/C++ with console app's, then programming Windows with the API, then a class library if you need too.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  9. #9
    Registered User
    Join Date
    Sep 2002
    Posts
    70
    Thank you. You have helped me see that consoe apps are also important. I will continue learning console C++ then learn Windows C++, then go up to MFC. Then i iwll take a break & start make some programs (start some big projects) then start learning assembler. Then i will be half way on the road to making my own OS!!!!

    How do i set the mode to non-console in VC++ so i don't get the error "undeclared identifier _main" ??

    help out mate please.....

  10. #10
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    click "project", go to "settings", click on the "link" tab.

    In the bottom edit box, scroll down until you see "/subsystem:console" and change it to "/subsystem:windows"

  11. #11
    Registered User
    Join Date
    Sep 2002
    Posts
    70
    Thanks,

    for a minute i thought VC++ was screwed. It works.

    Now i'll finish learning Windows Console things then i'll work from there!!!!

    There's a question that i asked in my last post......(on this thread)
    (i can't bother writing it again) Got any answers 'lol';

    ciao

  12. #12
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> There's a question that i asked in my last post

    There is? (You can always copy and paste, no need to type again).
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  13. #13
    Registered User
    Join Date
    Sep 2002
    Posts
    70
    Ahh.....actually that question has been answered, sorry my mistake.

    NOW i got another question....How do i make the console go full screen at a custom resolution, say 800x600 or 1000x1000

    I've seen it done in other thing so don't say u can't do it.

    And also can i make 3D Games and Graphics without knowing windows programming, by just knowing Windows C++ Console programming and OpenGL or Direct3D (DirectX)

    and what is that console in games that use the Quake 3 Engine??

    Please help out

  14. #14
    Registered User
    Join Date
    Sep 2002
    Posts
    70

    Unhappy

    Come on.....Please Help out if you can.....

  15. #15
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Bumping your own threads is against the rules here.

    You would be better off opening a new thread when starting a new topic - people tend to look at the number of replies against a particular thread and if it is more than a couple, assume someone else is dealing with it and ignore it.

    I can't help you with your query, I have never used Quake - I don't have time for games.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. disabling system keys in a windows console
    By Shadow in forum Windows Programming
    Replies: 3
    Last Post: 06-23-2002, 07:06 PM
  2. Question about console and windows programming
    By Unregistered in forum Windows Programming
    Replies: 2
    Last Post: 06-22-2002, 05:46 AM
  3. multiple console windows
    By gordy in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 02-13-2002, 11:05 PM
  4. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 10:19 AM
  5. windows dos console
    By dune911 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-16-2002, 11:30 PM