|
-
Feb 28th, 2001, 10:51 AM
#1
Thread Starter
Frenzied Member
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!
-
Feb 28th, 2001, 11:25 AM
#2
Frenzied Member
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.
is the same as this in VB:
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."
-
Feb 28th, 2001, 12:31 PM
#3
Thread Starter
Frenzied Member
Thanks again Harry! That helped alot!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|