Hi,
I am a relatively new MFC programmer and I have the following problem. In adding a second recordset to my dialog box, I want to add a combo box to list the names of all that is contained in my database. I used the following code
m_pSet = &GetDocument()->m_viewrecordSet;
m_pSet->m_pDatabase = pDoc->m_viewrecordSet.m_pDatabase;
CDialog::OnInitDialog();
// Fill the combo box with all of the names
ViewRecordsDlg* pDoc = GetDocument();
pDoc->m_viewrecordSet.m_strSort = "Name";
if (!pDoc->m_viewrecordSet.Open())
return;
// Filter, parameterize and sort the CViewRecordSet recordset
m_pSet->m_strFilter = "Name = ?";
m_pSet->m_strNameParam = pDoc->m_viewrecordSet.m_Name;
When I compiled, the following errors were encountered....
error C2065: 'GetDocument' : undeclared identifier
error C2227: left of '->m_viewrecordSet' must point to class/struct/union
error C2440: 'initializing' : cannot convert from 'int' to 'class ViewRecordsDlg *'
error C2561: 'OnInitDialog' : function must return a value
The error lies within these portion of my code but I do not know how to go about solving them. Pleae advice....Thanks!!!
I am a relatively new MFC programmer and I have the following problem. In adding a second recordset to my dialog box, I want to add a combo box to list the names of all that is contained in my database. I used the following code
m_pSet = &GetDocument()->m_viewrecordSet;
m_pSet->m_pDatabase = pDoc->m_viewrecordSet.m_pDatabase;
CDialog::OnInitDialog();
// Fill the combo box with all of the names
ViewRecordsDlg* pDoc = GetDocument();
pDoc->m_viewrecordSet.m_strSort = "Name";
if (!pDoc->m_viewrecordSet.Open())
return;
// Filter, parameterize and sort the CViewRecordSet recordset
m_pSet->m_strFilter = "Name = ?";
m_pSet->m_strNameParam = pDoc->m_viewrecordSet.m_Name;
When I compiled, the following errors were encountered....
error C2065: 'GetDocument' : undeclared identifier
error C2227: left of '->m_viewrecordSet' must point to class/struct/union
error C2440: 'initializing' : cannot convert from 'int' to 'class ViewRecordsDlg *'
error C2561: 'OnInitDialog' : function must return a value
The error lies within these portion of my code but I do not know how to go about solving them. Pleae advice....Thanks!!!