子ダイアログがあります。他の子ダイアログを開始します。2番目のダイアログには、リストボックスの次のコードがあります。最初の子ダイアログでm_selcomponentsにアクセスする必要があります。dlg->m_selcomponentsのようにこれにアクセスしようとしました。しかし、それはnullになりつつあります。これどうやってするの?助けてくれてありがとう。
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;
}