小丫请教各位大侠,我遇到了一个关于error C2512的错误 ,很头痛我的构造函数定义是:
IMPLEMENT_DYNCREATE(CConfigureDialog, CDialog)
CConfigureDialog::CConfigureDialog(CString ReaderName,CWnd* pParent )
: CDialog(CConfigureDialog::IDD, pParent)
, m_save(false)
{ //{{AFX_DATA_INIT(CConfigureDialog)
//}}AFX_DATA_INIT
//this->m_ReaderFrame = pFrame;
m_iCurPage = -1;
m_pages.RemoveAll();
m_pStartPage = NULL; m_csTitle = "Untitled";
this->m_Readername = ReaderName;
m_bValidateBeforeChangingPage = false;
//this->m_pReaderInformation= pReader;
CMainFrame* pMain = (CMainFrame*)::AfxGetMainWnd();
this->m_configureXML = &(pMain->m_configureXML); }
然后编译就报错,f:\work\7.9\LTKCPP\VS_LTKCPP\Rfid\SAPrefsDialog.cpp(48): error C2512: “CConfigureDialog” : 没有合适的默认构造函数可用
但是光标停留在IMPLEMENT_DYNCREATE(CConfigureDialog, CDialog) 请问大侠我该如何解决?
IMPLEMENT_DYNCREATE(CConfigureDialog, CDialog)
CConfigureDialog::CConfigureDialog(CString ReaderName,CWnd* pParent )
: CDialog(CConfigureDialog::IDD, pParent)
, m_save(false)
{ //{{AFX_DATA_INIT(CConfigureDialog)
//}}AFX_DATA_INIT
//this->m_ReaderFrame = pFrame;
m_iCurPage = -1;
m_pages.RemoveAll();
m_pStartPage = NULL; m_csTitle = "Untitled";
this->m_Readername = ReaderName;
m_bValidateBeforeChangingPage = false;
//this->m_pReaderInformation= pReader;
CMainFrame* pMain = (CMainFrame*)::AfxGetMainWnd();
this->m_configureXML = &(pMain->m_configureXML); }
然后编译就报错,f:\work\7.9\LTKCPP\VS_LTKCPP\Rfid\SAPrefsDialog.cpp(48): error C2512: “CConfigureDialog” : 没有合适的默认构造函数可用
但是光标停留在IMPLEMENT_DYNCREATE(CConfigureDialog, CDialog) 请问大侠我该如何解决?
修改构造函数为
CConfigureDialog(CString ReaderName="",CWnd* pParent=NULL ) 试下