VC++5.0 WinNT 4.0(3)
I have this class, derived from CWnd:
class CIndicator : public CWnd
{
Quote:
};
I have another class derived from CIndicator:
class CController : public CIndicator
{
Quote:
};
These are both "controls" to be placed on a dialog (or any other window).
CController is supposed to look like a CIndicator, but has control
functionality.
The way I'm implementing it now is to register two Win32 classes
"indicator" and "controller" and placing them in the dialog as custom
controls. The dialog class has static member variables for CIndicator
objects and CController objects. During OnInitDialog() I then subclass the
controls:
m_wndIndicator.SubclassWindow(GetDlgItem(XXXX)->m_hWnd);
The problem is that messages don't get passed up from CController if they
are not handled by CController. I've looked at the ctrltest sample
application and they do something similiar. The difference is that the
'parent' class for them is the windows common edit control and so unhandled
messages get pumped to the stock edit control, where in my case unhandled
messages get pumped to the WNDPROC function I specified when I registered
the classes.
Ok, so I tried setting the m_pfnSuper member of CWnd (like they do in
ctrltest). The problem is that all MFC CCmdTarget derived objects use the
same WNDPROC (AfxWndProc) and I get a stack overflow as appearently this
causes recursion in the code.
How do I get my base class to handle messages that are not handled by
CIndicator?
(I hope this question was clearly stated, It's a complex problem - what
with the bizarre way MFC tried to make Window's 'look' like C++)