Hi,
In my Dialog based MFC application, I have the below error w.r.t Constructor, even though multiple changes made in order, and types of params, the error w.r.t constructor still exists,
//Dialog.h
class CDlgMac : public CDialog
{
public:
CDlgMac (CMac*,CWrkShp*,CPtrList& ,CJoe&,CWnd* pParent = NULL);
-> Scenario -II on including Class Joe and Pointer in Constructor the error is depicted.
CJoe& m_Opt;
CPtrList& m_Obj;
In Dialog.cpp
//Adding CNewClass header file here.
#include "NewClass.h"
Scenario-I:
//CDlgMac ::CDlgMac (CMachine* pMachine,CWrkshp* pWkshp,CWnd* pParent /*=NULL*/)
// : CDialog(CDlgMac ::IDD, pParent), m_pMachine(pMachine),m_pWorkShop(pWorkShop)
{
//{{AFX_DATA_INIT(CDlgMac )
// NOTE: the ClassWizard will add member initialization here
// //}}AFX_DATA_INIT
}
Scenario-II:
CDlgMac::CDlgMac(CMac* pMac,CWrkShp* pWrkShp,CPtrList& ObjectLst,CJoe& OptPage2 ,CWnd* pParent )
: CDialog(CDlgMac::IDD, pParent), m_pMac(pMac),m_pWrkShp(pWrkShp),m_Obj(ObjectLst),m_Opt(OptPage2)
{
}
....
....
In OtherFile James.cpp
I invoke the following code,
...
...
CDlgMac dlg(pMac,m_pParent->GetWork(),NULL); ----> Error shown in this line
On build, I get the following errors,
1>error C2664: 'CDlgMac::CDlgMac(CMac *,CWrkShp *,CPtrList &,CJoe &,CWnd *)' : cannot convert parameter 3 from 'int' to 'CPtrList &'
Basically, my target is to initialize all the variables/datamembers using member initialisation lists, using pointer and class(reference).
Any help in resolving the above would be much appreciable.,
I am using VS2008IDE, MFC 9.0v.
With Regards,
VishalK