WindowProc in a class - function and pointer problem

D-sturbed someone at somewhere.com
Wed May 22 12:30:27 PDT 2013


Hello, is there a way to wrap a WindowProc (so "LRESULT 
WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
nothrow") in a class and to link it to a WindowClass without 
puting it as "static" ?

Because defacto every datum used in the WindowProc must also be 
static.
The problem technically is that if "static" is not specified, the 
compiler won't allow this: "MyWinClass.lpfnWndProc = 
&TheWindowProcInMyClass".

I've also tried this: "MyWinClass.lpfnWndProc = 
(&TheWindowProcInMyClass).funcptr" but, while it compiles, it 
drastically fails at the run-time...


More information about the Digitalmars-d-learn mailing list