October 16th, 2005, 03:01 PM
#1
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?)
October 17th, 2005, 08:02 AM
#2
Re: IMPLEMENT_DYNCREATE and abstract base classes
hi ... think this will work...
looks like no problem... :cool:
UPDATED
Attached Files
Last edited by Acidy; October 18th, 2005 at 01:10 AM .
Best regards, Alex Dronov
Let the poster of the answers know when they helped you: Click "Rate this post!
October 17th, 2005, 09:37 AM
#3
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.
October 18th, 2005, 01:12 AM
#4
Re: IMPLEMENT_DYNCREATE and abstract base classes
hi torfil!
if i understand you right, see the attachment posted above...
Best regards, Alex Dronov
Let the poster of the answers know when they helped you: Click "Rate this post!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width