T
tather
I found these code in http://www.parkscomputing.com
but I can not compile it successful.
------------------------------------------------
typedef LONG (__stdcall * forwardFn_t)(HWND, UINT, WPARAM, LPARAM);
template<UINT msg> class Handler;
template<> class Handler<WM_PAINT>
{
protected:
virtual void OnPaint() = 0;
public:
LRESULT Handle(WPARAM wParam, LPARAM lParam)
{
OnPaint();
return 0L;
}
static void Forward(HWND hWnd, forwardFn_t pfn)
{
(*pfn)(hWnd, msg, 0L, 0L);
}
};
but I can not compile it successful.
------------------------------------------------
typedef LONG (__stdcall * forwardFn_t)(HWND, UINT, WPARAM, LPARAM);
template<UINT msg> class Handler;
template<> class Handler<WM_PAINT>
{
protected:
virtual void OnPaint() = 0;
public:
LRESULT Handle(WPARAM wParam, LPARAM lParam)
{
OnPaint();
return 0L;
}
static void Forward(HWND hWnd, forwardFn_t pfn)
{
(*pfn)(hWnd, msg, 0L, 0L);
}
};