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

    Class multiple constructor

    Hi,
    I have created a class, derived from CView MFC base class.

    I have the default constructor as usual.

    I want to get CDC* pDC and CPrintInfo* pInfo objects at the creation of
    this class.

    I have tried to utilize another constructor but without success.

    When I create this class from a Generic C++ class instead from a MFC, I can
    have more than one class constructor. If I do that with a MFC derived
    class, I can have multiple constructor.

    Why ?

    Thanks for any help

    Claude

    //////////////////////////////////////////////////////////////////////
    // Construction/Destruction
    //////////////////////////////////////////////////////////////////////
    CFondPrint::CFondPrint()
    {

    }


    CFondPrint::CFondPrint(CDC* pDC, CPrintInfo* pInfo)
    {
    // Printing class library in action
    pPage = new CPage(pInfo->m_rectDraw, pDC);

    // Times New Roman font
    pPage->SetFont("Times New Roman");

    }



  2. #2
    Join Date
    Apr 1999
    Posts
    43

    Re: Class multiple constructor

    Hint: Normaly Views are in the Doc/View-Framework always created dynamicaly on the heap over the default-constructor. -> DECLARE_DYNCREATE-MACRO

    Mike



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