F
farseer
Can someone please assist me in understanding why i am receiving this
error: " error C2440: 'type cast' : cannot convert from 'LRESULT
(__cdecl CMyToday::* )(HWND,UINT,WPARAM,LPARAM)' to 'LONG' "
Here is the source snippet that is causing this compile error. The
error is caused by the SetWindowLong line below.
MyDataWin.h
WNDPROC _hOldWndProc;
BOOL Create( HWND hWndParent, DWORD dwStyle = WS_VISIBLE | WS_CHILD
);
LRESULT CALLBACK EditWinProc( HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam );
MyDataWin.cpp
BOOL MyDataWin::Create( HWND hWndParent, DWORD dwStyle )
{
_hEditBox = CreateWindow( L"EDIT", NULL, WS_CHILD | WS_VISIBLE |
ES_AUTOHSCROLL, 2, 2, 100, 20, m_hWnd, NULL, _hInstance, NULL );
_hOldWndProc = SetWindowLong( _hEditBox ,GWL_WNDPROC, (LONG)
EditWinProc );
}
LRESULT CALLBACK MyDataWin::EditWinProc( HWND hWnd, UINT uMsg, WPARAM
wParam, LPARAM lParam )
{
....
....
}
error: " error C2440: 'type cast' : cannot convert from 'LRESULT
(__cdecl CMyToday::* )(HWND,UINT,WPARAM,LPARAM)' to 'LONG' "
Here is the source snippet that is causing this compile error. The
error is caused by the SetWindowLong line below.
MyDataWin.h
WNDPROC _hOldWndProc;
BOOL Create( HWND hWndParent, DWORD dwStyle = WS_VISIBLE | WS_CHILD
);
LRESULT CALLBACK EditWinProc( HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam );
MyDataWin.cpp
BOOL MyDataWin::Create( HWND hWndParent, DWORD dwStyle )
{
_hEditBox = CreateWindow( L"EDIT", NULL, WS_CHILD | WS_VISIBLE |
ES_AUTOHSCROLL, 2, 2, 100, 20, m_hWnd, NULL, _hInstance, NULL );
_hOldWndProc = SetWindowLong( _hEditBox ,GWL_WNDPROC, (LONG)
EditWinProc );
}
LRESULT CALLBACK MyDataWin::EditWinProc( HWND hWnd, UINT uMsg, WPARAM
wParam, LPARAM lParam )
{
....
....
}