Results 1 to 3 of 3

Thread: Stupid question, I know, but...

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    VB is easy, really easy compared to C++ right??
    Well something(s!!!) really confuse me with C++
    Fx.

    Code:
    HWND hwnd;
    MSG  msg;
    What does this do??Does it make hwnd equal to HWND, or is a variable with the HWND created or??????!!!!!
    It's the same with this:
    Code:
    LRESULT CALLBACK WindowProc(HWND hwnd,
    									UINT msg, WPARAM wparam, LPARAM lparam)
    What does LRESULT and CALLBACK mean, is somekind of WORD parameter passed on to wParam???

    Sorry if this is only a bunch of stupid questions!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    It's just a different syntax to VB. Perhaps the reason you don't recognise it is because you haven't seen these data types before.

    HWND is a datatype for a window handle.

    Code:
    HWND hwnd;
    is the same as this in VB:
    Code:
    Dim hwnd as hWnd
    MSG is the datatype for a windows message. These are defined in windows.h I believe.

    LRESULT is just another datatype.


    Code:
    LRESULT CALLBACK WindowProc(........
    here, LRESULT is the return type of the function WindowProc(). The return type always comes first in the function header. CALLBACK here means that it is a callback function, it's just a kind of function. I think it means that it's a function that is called by something outside your application. In this case, WindowProc is called by the Windows O/S whenever you dispatch a message to Windows. You tell Windows which function you want it to use to process messages when you register the window class for your window. You can have different functions for different window classes in your app if you like.
    Harry.

    "From one thing, know ten thousand things."

  3. #3

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Thanks again Harry! That helped alot!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width