Thread: Win32 in C++? (Is that what this tut is?)

  1. #1
    #junkie
    Join Date
    Oct 2004
    Posts
    240

    Win32 in C++? (Is that what this tut is?)

    http://www.relisoft.com/win32/winnie.html

    I was searchin for some more win32 tutorials so i can get a broad band of learning of you will,

    well i ran into that link. And by the source on that page,
    Code:
    #include <windows.h>
    
    
    LRESULT CALLBACK WindowProcedure
        (HWND hwnd, unsigned int message, WPARAM wParam, LPARAM lParam);
    
    class WinClass
    {
    public:
        WinClass (WNDPROC winProc, char const * className, HINSTANCE hInst);
        void Register ()
        {
            ::RegisterClass (&_class);
        }
    private:
        WNDCLASS _class;
    };
    
    WinClass::WinClass
        (WNDPROC winProc, char const * className, HINSTANCE hInst)
    {
        _class.style = 0;
        _class.lpfnWndProc = winProc; // window procedure: mandatory
        _class.cbClsExtra = 0;
        _class.cbWndExtra = 0;
        _class.hInstance = hInst;         // owner of the class: mandatory
        _class.hIcon = 0;
        _class.hCursor = ::LoadCursor (0, IDC_ARROW); // optional
        _class.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1); // optional
        _class.lpszMenuName = 0;
        _class.lpszClassName = className; // mandatory
    }
    (Just a snipplet)
    Now correct me if i am wrong, but it looks like this is a win32 setup redesigned to be in C++?
    Can someone check this page out (who knows more about win32) and tell me if it has everything it should?
    If so id much rather use this method because i know very little C (its format is just foreign) and C++ format would be much nicer to deal with.

    Thanks to any replies!
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Yes - Win32 API will work in C++ too, and that's what that is. The tutorial looks decent, but it just doesn't seem very complete. What I'd do is go through that tut series, and then browse through a couple ofhter options, just to make sure you're getting a well-rounded look at the subject.

  3. #3
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    kool, cuz i was taking the forgers tutorial, and it seems very complete (not too far into it yet though), but the whole C structuring of everything just kinda made it a bit odd to me.
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Once you're comfortable with what this tutorial teaches you, try going back through Forger's. The C syntax will still be just as hard, but with your new knowledge of the basics of Win32, it might be easier to understand the concepts Forger's teaches you later.

  5. #5
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    oh im getting the forges tutorial, infact i think he explains it more clearly. And i'v come used to the c syntax but i just dont like the overall structure. So for learning i'll do them both, but when im creating mini projects of my own imma use that lovely C++ snytax heh
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  6. #6
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    >>own imma use that lovely C++ snytax heh

    Once you have the basics then look at MFC (MS Foundation Classes)

    MFC is a framework that allows rapid WIN32 dev allowing you to concerntrate on the C++ (rather than the WIN32)
    "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

  7. #7
    #junkie
    Join Date
    Oct 2004
    Posts
    240
    rapid Win32 development? so far win32 has been pretty straight forward, is MFC just a streamlined Win32?

    Also, i keep reading about Resource Visual Editors and whatnot, as aposed to editing resource dialogs by hand (text), Does Dev C++ have this? And what is it exactly? A way of drag dropping items in dialogs?
    01110111011000010110110001100100011011110010000001 11000101110101011010010111010000100000011011000110 10010110011001100101001000000111100101101111011101 0100100000011011100111010101100010

  8. #8
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    MFC is what's called a wrapper. Someone's basically made an interface for the Win32 API. Instead of having to do all these crazy things that don't make sense until you're knee deep in the API, it's been redesigned to make more sense in the way laypersons would think about Windows.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Console program to Win32
    By Ducky in forum Windows Programming
    Replies: 3
    Last Post: 02-25-2008, 12:46 PM
  2. Win32 API or Win32 SDK?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 07-20-2005, 03:26 PM
  3. OLE Clipboard :: Win32 API vs. MFC
    By kuphryn in forum Windows Programming
    Replies: 3
    Last Post: 08-11-2002, 05:57 PM
  4. Thread Synchronization :: Win32 API vs. MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 08-09-2002, 09:09 AM
  5. Win32 API Tutorials?
    By c++_n00b in forum C++ Programming
    Replies: 9
    Last Post: 05-09-2002, 03:51 PM