0

Hey, I've been working on my movement and controls and I've got a solid "DoInput(WPARAM wParam)" method built up. When I try to call it from WndProc like this:

switch (message)
	{
	case WM_CLOSE:
		{
			g_bDone = true;
			PostQuitMessage( 0 );
		} break;
	case WM_KEYDOWN:
			[B]DoInput(wParam);[/B]
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;

(Entire WndProc body there).

I get a " Error 1 error C2352: 'Controls::DoInput' : illegal call of non-static member function c:\development\mine\Controls\source\Controls.cpp 275 " error.

My question is; what exactly do I need to do to my DoInput method to make it legal?

The declaration looks like this:

void DoInput(WPARAM wParam);

If I simply make it "static void" I get many errors about illegal references to my position variables.

Thanks!

Edited by JustSuds: n/a

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by JustSuds
0

Problem solved!

I just made a global variable WPARAM wPara, and in my WndProc I set wPara to wParam. Calling DoInput with my wPara value from a generic update method.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.