I'm getting the following error when I try to convert to long GameState::SubClassProc , which is a method I created. However, if I create a method outside of the class, it works fine, for example, just (long) SubclassProc
I try adding an & before GameState::SubClassProc, but it doesn't help.
The error for my code
Code: Select all
g_ogreWinProc = (WNDPROC) SetWindowLong(hwnd, GWL_WNDPROC, (LONG) GameState::SubClassProc);
Code: Select all
Error 3 error C2440: 'type cast' : cannot convert from 'LRESULT (__stdcall GameState::* )(HWND,UINT,WPARAM,LPARAM)' to 'LONG'
To gamestate from advanced framework , I have added:
GameState.h
Code: Select all
//Only changes are shown.
//Windows Only
LRESULT APIENTRY SubClassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
//for windows only
WNDPROC g_ogreWinProc;
HWND hwnd;
//
Code: Select all
OgreFramework::getSingletonPtr()->m_pRenderWnd->getCustomAttribute("WINDOW", (void*)&hwnd);
g_ogreWinProc = (WNDPROC) SetWindowLong(hwnd, GWL_WNDPROC, (LONG) GameState::SubClassProc);
thanks