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

    Message maps in derived base classes?

    Hi,

    What is a derived base class?

    I had wanted to create a base PropertyPage class CMyBasePage : CPropertyPage
    and then create my own property pages based from that class CMyPage : CMyBasePage

    Why?
    I have a property sheet with pages that are nearly alike. I already have
    them using the same Dialog resource and through a little manipulation,
    I already have seperate titles for each page.

    Since about 80% of the controls were the same I thought I would create a
    base class and and put those controls in the base class, with their own message maps.
    And then create a derived class for the differences. The base class has a index variable
    that specifies which page in the property sheet it is.

    This almost works accept for one problem. The controls in the base class
    don't have a real window associated
    with them. When I try to use them, the debugged controls assert
    ASSERT(::IsWindow(m_hWnd));
    and fail because m_hWnd = 0.

    If I move the control message maps into the derived class everything
    works (m_hWnd is valid).

    Is there a way around this or do I have to redfine the same control
    message maps for each derived page?


    Thanks in advance,

    Rob Adelberg
    ARINC


  2. #2
    Join Date
    Jun 1999
    Location
    Germany
    Posts
    343

    Re: Message maps in derived base classes?

    Hello,

    try this:

    void CMyPage:oDataExchange(CDataExchange* pDX)
    {
    CBaseMyPage:oDataExchange(pDX);

    }




    I hope it helps)


    Gerd

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