Okay.

I have two Dialogs, lets call them IDD_DLG1 and IDD_DLG2.

On IDD_DLG1 I have an array of CStrings(lets say 50). There is a CListBox control on IDD_DLG2. Why does this not work:


IDD_DLG1 code:

User clicks "View List of Names" button (the array of CStrings) on IDD_DLG1.

Code:
CDLG2 myDlg;

myDlg.DoModal();

for(int i = 0; i < 50; i++)
{
    myDlg.ListBox.AddString(names[i]);
}