I am having a property sheet where it does contain 4 pages.In the second page I am having a list control where it is getting enumerated by some values.In the third page I am having a listbox.whatever the value listcontrol is getting enumerated of second page ,should get added to the listbox in the third page. //DDX routine for second page listcontrol is as follows.
void DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST_MODEL, m_listCtrl);
}
//DDX routine for the third page lisbox is as follows.
void DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST_BOX, m_listBoxCtrl);
}
And in the second page OnWizardNext() I added the following code to assign the second page listcontrol values to the third page member variables.
LRESULT OnWizardNext()
{
UpdateData(TRUE);
int nListItemCount = m_listCtrl.GetItemCount();
m_str = m_listCtrl.GetItemText(0,1);
m_str1 = m_listCtrl.GetItemText(0,2);
m_str2 = m_listCtrl.GetItemText(0,3);
//assigning the second page data member values to the third page member variables.
CConfirmationView dlg;//third page class
dlg.m_szItemData.Format(L" %s",m_str);
dlg.m_szItemData1.Format(L" %s",m_str1);
dlg.m_szItemData2.Format(L" %s",m_str2);
UpdateData(FALSE);
return CPropertyPage::OnWizardNext();
}
And in the third page OnInitDialog() I am added this piece of code to add the value that is retrieved from second page listcontrol to the third page listbox as follows.
BOOL OnInitDialog()
{
CPropertyPage::OnInitDialog();
Updatedata(FALSE);
m_ListBoxCtrl.AddString(m_szItemData);
m_ListBoxCtrl.AddString(m_szItemData1);
m_ListBoxCtrl.AddString(m_szItemData2);
return TRUE;
}
This is how I am doing.I want the item's data of the listcontrol(second page) to get added to the listbox (third page) . Can anyone please let me know how we can exchange the data between the pages.
Thanks in advance..