Jump to content
  • Advertisement
Sign in to follow this  
packagedeliverer

lparam and wparam undeclared??

This topic is 4814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Shouldnt that be:
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wParam,
LPARAM lParam)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!