lparam and wparam undeclared??

Started by
6 comments, last by packagedeliverer 18 years, 7 months ago
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?
Advertisement
did you: #include <windows.h> ?

Beginner in Game Development?  Read here. And read here.

 

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...
Case sensitivity. lParam != lparam
Shouldnt that be:
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam)

Quote:Original post by SiCrane
Case sensitivity. lParam != lparam


THANKS! :D
You saved my day (why does it allways have to turn out being dumb errors).

This topic is closed to new replies.

Advertisement