我有一个子对话框。我启动其他子对话。在第二个对话框中,我有以下列表框代码。我需要在第一个子对话框中访问 m_selcomponents。Itried 像 dlg->m_selcomponents 一样访问它。但它变得空了。我怎样才能做到这一点?谢谢你的帮助。
int count = m_OutList.GetCount();
for ( i = 0; i <m_OutList.GetCount(); i++)
{
m_OutList.GetText( buf[i], text );
m_selcomponents->Add(text);
}
MSelCFLCompDlg *SelCflCompDlg= new MSelCFLCompDlg(&allcomponents, &m_cflcomponents,m_FileDecimal,this) ;
if(SelCflCompDlg->DoModal()==IDOK) { selectedcomponents.Append(*SelCflCompDlg->m_selcomponents); }
MSelCFLCompDlg::MSelCFLCompDlg(CStringArray *all, CStringArray *sel,int, CWnd* pParent /*=NULL*/)
: CDialog(MSelCFLCompDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(MSelCFLCompDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_allcomponents = all;
m_selcomponents = sel;
}