IMPLEMENT_DYNCREATE and abstract base classes
I have
CScrollView which inherits from CView
- it add some virtual methods.
CEditScrollView whith inherits from CScrollView
- it implements those virtual methods.
In EditScrollView..h/cpp, I have
DECLARE_DYNCREATE(CEditScrollView)
IMPLEMENT_DYNCREATE(CEditScrollView, CScrollView)
I do NOT have those specified for CScrollView (since it is an abstract class)
In "Debug" configurations, this compiles fine.
In "Release" configurations, I get the following error:
error C2039: 'classCScrollView' : is not a member of 'CScrollView'
This suggests I need to have a IMPLEMENT_DYNCREATE(CScrollView, CView), but of course, it won't let me do that since the class is abstract.
Is it safe to instead to
IMPLEMENT_DYNCREATE(CEditScrollView, CView)
(thus "skipping" the immediate base class?)
1 Attachment(s)
Re: IMPLEMENT_DYNCREATE and abstract base classes
hi ... think this will work...
looks like no problem... :cool:
UPDATED
Re: IMPLEMENT_DYNCREATE and abstract base classes
Oops, I kind of posted a bad example above. I didn't realize CScrollView was actually an MFC class!
Ok, well pretend its actually my own class, with pure virtual methods on it.
Re: IMPLEMENT_DYNCREATE and abstract base classes
hi torfil!
if i understand you right, see the attachment posted above... :cool: