I have a helper class, CMyHelper, whose job is to manage certain messages of a given window. I do this by replacing the original window procedure of the given window with one defined in my helper class (see below). I set a property in the HWND of this given window to be a pointer to the CMyHelper class, so I can access it in my custom WNDPROC:
// Handler for the WM_NCPAINT message
virtual LRESULT OnNcPaintHandler ( HRGN hUpdateRgn );
// Window whose WNDPROC we are replacing
// Replacement WNDPROC
static LRESULT CALLBACK CustomWndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM );
/*static*/ LRESULT CALLBACK CMyHelper::CustomWndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
CMyHelper* pHelper = ( CMyHelper*) GetProp ( hwnd, _T("HELPER") );
switch ( msg )
// Call handler for WM_NCPAINT
pHelper->OnNcPaintHandler ( ( HRGN ) wParam )
/* virtual */ LRESULT CMyHelper::OnNcPaintHandler ( HRGN hUpdateRgn )
// Call base class handler for WM_NCPAINT ************* PROBLEM
// Handle WM_NCPAINT message in our special way...
I have indicated the problem above. I need to call the base class handler for WM_NCPAINT. By "base class handler", I don't mean "original window procedure", I literally mean "base class". Say that the m_pWnd member in our class is a CMyWnd, derived from CWnd: I want to call CWnd::OnNcPaint, not the original window procedure which would be CMyWnd::OnNcPaint.
Put more simply, I want to do the following, using Microsoft's magic __super keyword:
The compiler complains though, stating that CMyHelper does not have any base classes. Well, yeah, but that is not what I am trying to do...
does now work.
How can I achieve what I am after?