This is a continuation from this question.
I have the following assignment:
WNDCLASSEX wndClass =
{
sizeof( WNDCLASSEX ), CS_CLASSDC, MsgProc, 0, 0,
GetModuleHandle( NULL ), NULL, NULL, NULL, NULL,
"D3D Tutorial", NULL
};
wc = wndClass;
Which gives me the following error:
1>e:\rat_engine\rat_engine\rat_engine\rat_rendererdx9.cpp(19): error C2440: 'initializing' : cannot convert from 'overloaded-function' to 'WNDPROC'
1>None of the functions with this name in scope match the target type
With MsgProc underlined as the cause, it should reference the following function:
LRESULT WINAPI RAT_RendererDX9::MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_DESTROY:
CleanUp();
PostQuitMessage( 0 );
return 0;
case WM_PAINT:
Render();
ValidateRect( hWnd, NULL );
return 0;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}
In the tutorial it works like this and I have copied it almost exactly. So where does the error come from and how can I fix it?
edit:
The declaration of MsgProc is:
private:
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );