On Jul 18, 3:54 am, tather <tat...@gmail.comwrote:
Quote:
I found these code inhttp://www.parkscomputing.com
but I can not compile it successful.
Quote:
------------------------------------------------
Quote:
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
Quote:
Why the error occur, and How can I resolve it to get the same fuction?
The error occured (obviously) because there is no symbol msg
declared which is visible in the scope of the function. In
fact, the only symbol msg I see anywhere is as an argument to
the template declaration; since it is a declaration, and not a
definition, the symbol is really only a comment, and not
accessible anywhere.
What did you mean instead of msg? WM_PAINT? Or something else?
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34