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 msgclass 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);
}
};
----------------------------------------------------
error C2065: 'msg' : undeclared identifier
Why the error occur, and How can I resolve it to get the same fuction?