How to register class member function as lpfnWndProc? Cannot convert delegate to function

deed none at none.none
Fri Sep 28 10:54:31 PDT 2012


Hi

I am trying to register a class member function as 
wc.lpfnWndProc, but get the error message "cannot implicitly 
convert expression (&this.WndProc) of type extern (Windows) int 
delegate(...) to extern (Windows) int function(...).

I have:

extern (Windows)
class App
{
     HRESULT initialize(HINSTANCE hInstance, int iCmdShow)
     {
         WNDCLASS wc;
         ...
         wc.lpfnWndProc = &wndProc;
         ...
     }

     HRESULT wndProc(HWND hwnd, UINT message, WPARAM wParam, 
LPARAM lParam)
     {
         switch (message)
         {
             ...
         }
     }
     ...
}


(Defining wndProc as a global function works, but is not what I 
want to do...)
What is the issue here and how do I make it work?


More information about the Digitalmars-d-learn mailing list