I have an application where I have a class CMyView.
In this class, I have created an array for functions e.g.
typedef void (CMyView::*m_f)(CDC* pDC);
CArray <m_f, const m_f&> m_farray;
This works fine, because I can do things like
m_farray.Add( &CMyView::Function1 );
However, I have a problem. What I would like to do is to derive a new class from CMyView e.g. CMySecondView. From this, I want to add functions from this derived class and place them in the same array so that the base class can perform operations on them e.g. I want to do
m_farray.Add( &CMySecondView::Function9 );
I run into compilation problems if I try to do this.
Can anybody see a way I can do this?
That is, I want the array of functions which are dealt with in the base class to be able to store functions from the dervived class.