Thread: Windows Gui Question

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    9

    Windows Gui Question

    I was wondering is there a better Windows gui library that is just like WinAPI but better overall. Meaning Native coding and doesnt' require a certain feature to be installed cause WinAPI is mainly for C and was wondering is thwere one made for C++ besides the .NET frames and MFC?

  2. #2
    Registered User
    Join Date
    Sep 2003
    Posts
    224
    You could try GTK+: http://www.gimp.org/windows/. But I think MFC is pretty good.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    903
    1. MFC = Spaghetti code. It's the worst thing ever.
    2. You can very well use GDI (what you call WinAPI) in C++.

    Here's a small example:
    Code:
    class IControl {
        protected:
            IControl() : Caption(0) { }
    
        public:
            virtual HWND CreateControl(POINT, UINT, UINT) = 0;
            void SetPosition(POINT);
            void SetPosition(UINT, UINT);
            void SetSize(RECT);
            void SetCaption(LPSTR);
    
        protected:
            HWND WndSelf;
            POINT Position;
            RECT ClientRect;
            LPSTR Caption;
    };
    
    class EditControl : public Control {
        public:
            EditControl() { }
            virtual HWND CreateControl(POINT, UINT, UINT);
    };
    
    // ....
    
    std::list<IControl*> Controls;
    Controls.push_back(new EditControl);
    Controls.push_back(new ButtonControl);
    
    IControl* ptr = 0;
    std::list<IControl*>::iterator iter;
    for(iter = Controls.begin(); iter != Controls.end(); iter++) {
        (*iter)->CreateControl( /*... */ );
        if((ptr = dynamic_cast<EditControl*>(*iter)) != NULL) {
            // We have an edit control here
        } else if((ptr = dynamic_cast<ButtonControl*>(*iter)) != NULL) {
            // We have a button control here
        }
    }
    Is this C++ enough for you ?

    OOP, Inheritance, polymorphism, dynamic_cast, STL containers...
    Last edited by Desolation; 05-19-2006 at 08:59 AM.

  4. #4
    Registered User
    Join Date
    Apr 2006
    Posts
    137
    what is that???? :S :S :S

    yeah i heard MFC is bad, why is that?

    Also, i use just a class like the one at www.foosyerdoosprogramming.fsnet.co.uk

  5. #5
    Registered User
    Join Date
    Dec 2003
    Posts
    167
    You may want to have a look at Qt http://www.trolltech.com/ or wxWidgets http://www.wxwidgets.org/ .
    silk.odyssey

  6. #6
    Registered User
    Join Date
    Sep 2003
    Posts
    224
    You can't please everyone. I used to hate it. But once I got down the concept of messages (which is almost transparent in MFC) and understand how to use control variables, I thought MFC was great. If I were developing a major app, I'd probably choose MFC over C#.

  7. #7
    Registered User
    Join Date
    Dec 2003
    Posts
    50
    You might also want to check out Ultimate++.

    Ultimate++ is a C++ cross-platform rapid application development suite. It includes a set of libraries (GUI, SQL, etc..), and an integrated development environment.
    Best Regards,
    Yeoh

  8. #8
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    "A bad workman blames his tools."

    Nothing (too much) wrong with MFC. Is much faster than WIN32 and if you know how to use both it allows for much faster development.

    >>www.foosyerdoosprogramming.fsnet.co.uk

    If you ask nicely Mr Fitlike may actually answer your questions in person...
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  2. Replies: 7
    Last Post: 08-28-2003, 10:15 PM
  3. C++ Question Regarding Windows
    By themyth in forum C++ Programming
    Replies: 3
    Last Post: 02-20-2003, 08:22 PM
  4. Windows API / GUI stuph
    By JagWire in forum Windows Programming
    Replies: 2
    Last Post: 03-11-2002, 03:30 PM
  5. Linux's GUI slower than windows'....
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 02-16-2002, 08:47 PM