Starting Over

This is a discussion on Starting Over within the C++ Programming forums, part of the General Programming Boards category; Ok, I've been convinced, I need to give up the ghost on the DOS/C complier and graduate on. The direction ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    9

    Cool Starting Over

    Ok, I've been convinced, I need to give up the ghost on the DOS/C complier and graduate on. The direction I take will probable be based on a the responses to a few questions

    1) Does C++ have the same program flow as C ?. (More of a top down main() ) type flow. I've work a little with MFC and as I remember, I had to try to operate from a " window update monitoring" function. It was very restricting.

    2) In order to write GUI type programs do I have to use MFC? (Concerning screen modes or back/fore ground colors, drawing )

    3) Can C++ (Visual) have the ability to create GUIs that will allow for drawing graphics on screen, or is everything handled through pre formed bitmaps.

    Thanks in advance.

    Ace

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by AceBlkwell View Post
    Ok, I've been convinced, I need to give up the ghost on the DOS/C complier and graduate on. The direction I take will probable be based on a the responses to a few questions

    1) Does C++ have the same program flow as C ?. (More of a top down main() ) type flow. I've work a little with MFC and as I remember, I had to try to operate from a " window update monitoring" function. It was very restricting.
    Do not confuse the way MFC works with C++ in general.

    In C++ you can still write code in a similar way to C [in fact, with very few exceptions, standard C code will work just fine compiled by a C++ compiler].

    However, "proper" C++ programming involves usind and understanding object oriented programming, and the whole model is different. You start by looking at what you need to do, then construct objects that reflect what you need to do. You need to look into object oriented programming to understand this.

    There is of course no reason to use C++ unless you want to - all of the main, modern C++ development environments still also support C.

    2) In order to write GUI type programs do I have to use MFC? (Concerning screen modes or back/fore ground colors, drawing )
    Not at all. You can use the Win32 API directly, or you can use another "framework" library. Of course, moving from a console [dos-style] environment to a GUI type environment, you will have to adopt a slightly different style. You have to deal with a different type of interaction between the user, the OS and the application, for example - and that may be where you feel that MFC is strange.

    GUI programming is primarily event-driven, and events of different kinds come in and are "handled" by different "callbacks". So you don't just start at main, run through a bunch of functions and then return back again through main. [Although neither of these modes of operation is striclty related to the "top down design", that's a different subject].


    3) Can C++ (Visual) have the ability to create GUIs that will allow for drawing graphics on screen, or is everything handled through pre formed bitmaps.

    Thanks in advance.

    Ace
    Yes, you can draw individual pixels, lines, curves, circles, boxes, bitmaps and whatever else you like in the Windows API [and in MFC, should you wish to use that - I personally only use MFC for Windows programming, but then I don't do much GUI programmin in general].

    You can ALSO use for example DirectDraw or Direct3D to draw things to the screen.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    > 2) In order to write GUI type programs do I have to use MFC?
    No, there are plenty of other GUI toolkits about, and some of them run on operating systems not called windows.
    http://en.wikipedia.org/wiki/List_of_widget_toolkits

    I strongly suggest you learn the language before trying to learn anything specific to any one operating system. It's important that you maintain the distinction in your mind.

    > 3) Can C++ (Visual) have the ability to create GUIs that will allow for drawing graphics on screen
    Ultimately, you can write your own code to set each pixel however you want. The toolkits aim to provide a consistent UI experience for your users, with minimal programming effort on your part.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Assuming you're on a Windows platform, here's a good WinAPI Tutorial. The WinAPI is "lower level" than MFC or .NET. The Petzold book also teaches the WinAPI.

    I think the WinAPI is the place to start if you want to understand Windows GUI programming. I've never used MFC or .NET, but I think they hide the details from you.

    The WinAPI does not require C++. The Petzold book uses C examples, and I think the tutorial does too. The book & tutorial show you to use the WinAPI finctions, and these fuctions can be used in a C program, or in an object oriented C++ program.

  5. #5
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,450
    Windows API is a pain to use. There's nothing bad in using MFC or .NET (and if you use .NET you don't have to do any WinAPI tutorial at all) w/o knowing any WinAPI mostly.
    You should know how things are connected - for example, that all controls are child window of your dialog, the parent window. Otherwise you don't need to fumble around with the WinAPI very much. OK, so a little, but not very much.
    Use MFC or .NET if you can and not the API.

  6. #6
    Registered User
    Join Date
    Nov 2007
    Posts
    9

    Thanks

    Hey thanks for the input everyone. You've given me something to think about. I'm not sure how I will proceed but I know I can't hold on to DOC/C just because I know it better LOL.

    Ace

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Starting programs
    By Molokai in forum C Programming
    Replies: 1
    Last Post: 04-16-2009, 10:10 AM
  2. Replies: 9
    Last Post: 03-20-2009, 05:22 PM
  3. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 05:59 PM
  4. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  5. question about reading inputs starting with 0
    By jibbles in forum C Programming
    Replies: 8
    Last Post: 08-09-2004, 03:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21