Click to See Complete Forum and Search --> : Class multiple constructor


Claude Gagnon
April 12th, 1999, 07:04 AM
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");

}

Mike Wild
April 12th, 1999, 09:26 AM
Hint: Normaly Views are in the Doc/View-Framework always created dynamicaly on the heap over the default-constructor. -> DECLARE_DYNCREATE-MACRO

Mike