Click here to Skip to main content
15,868,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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..
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900