Hi guys,
I am writting a wrap-around class for win32 for my game project and need some help/advice. Heres the problem; I have a class called "CGameApp" which the functions responsable for creating a OpenGL/win32 window is located along with other functions.
Display All
Display All
Display All
When I build the project I get the following message;
"error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'WNDPROC'"
How can I get around this probem?
Thanks again for the help
Sabrina
I am writting a wrap-around class for win32 for my game project and need some help/advice. Heres the problem; I have a class called "CGameApp" which the functions responsable for creating a OpenGL/win32 window is located along with other functions.
Brainfuck Source Code
- BOOL CGameApp::CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag)
- {
- .
- .
- .
- m_bFullScreen=fullscreenflag;
- m_hInstance = GetModuleHandle(NULL);
- m_WndCls.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
- m_WndCls.lpfnWndProc = (WNDPROC) WndProc; // <--------- PROBLEM!!
- m_WndCls.cbClsExtra = 0;
- m_WndCls.cbWndExtra = 0;
- .
- .
- .
- more code.
Source Code
- //LRESULT CALLBACK CGameApp::WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- int CGameApp::WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
- switch (uMsg) // Check For Windows Messages
- {
- case WM_ACTIVATE: // Watch For Window Activate Message
- {
- if (!HIWORD(wParam)) // Check Minimization State
- {
- m_bIsRunning = true; // Program Is Active
- .
- .
- .
- more code.
Source Code
- INT WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, INT )
- {
- int tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- _CrtSetDbgFlag(tmpDbgFlag);
- g_pApp->InitInstance(); // This will initilize the windows part of the game.
- // g_pGame->InitGame();
- // g_pGame->GameLoop();
- // g_pGame->GameShutdown();
- _CrtDumpMemoryLeaks();
- return 1;
- }
When I build the project I get the following message;
"error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'WNDPROC'"
How can I get around this probem?
Thanks again for the help
Sabrina
The post was edited 1 time, last by Sabrina ().