CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2005
    Posts
    104

    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?)

  2. #2
    Join Date
    Jul 2005
    Location
    Russian Federation. Moscow
    Posts
    152

    Arrow Re: IMPLEMENT_DYNCREATE and abstract base classes

    hi ... think this will work...
    looks like no problem... :cool:

    UPDATED
    Attached Files 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!

  3. #3
    Join Date
    Aug 2005
    Posts
    104

    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.

  4. #4
    Join Date
    Jul 2005
    Location
    Russian Federation. Moscow
    Posts
    152

    Cool 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
  •  





Click Here to Expand Forum to Full Width

Featured