lparam and wparam undeclared??
I'm trying to get the x and y co. of the mouse using the following:
[script] switch(msg){
...
case WM_MOUSEMOVE:
{
// get the position of the mouse
int mouse_x = (int)LOWORD(lParam);
int mouse_y = (int)HIWORD(lParam);
...
...
} break;
}
...
[/script]
But it returns this:
C:\...\test8.cpp(160) : error C2065: 'lParam' : undeclared identifier
C:\...\test8.cpp(163) : error C2065: 'wParam' : undeclared identifier
It should normally work right? What's wrong? Am I forgetting to define/include something?
Are the variables lParam and wParam declared in that function? They are supposed to be the last two parameters to the window message function. Did you perhaps mistype their names in the function declaration?
Quote:Original post by Alpha_ProgDes
did you: #include <windows.h> ?
Of course I did :(
Here is the cpp file:
http://www.packagedeliverer.l2p.net/temp.txt (might be kinda messy)
Quote:Original post by Dave Hunt
Are the variables lParam and wParam declared in that function? They are supposed to be the last two parameters to the window message function. Did you perhaps mistype their names in the function declaration?
You mean this:
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wparam,
LPARAM lparam)
Well, they're there...
Shouldnt that be:
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam)
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement