This isn't my exact code (i'm at work) but this should explain what I am doing.
Code:
CMainDlg::OpenChildWindow()
{
CChildDlg *dlg=new CChildDlg(this);
dlg->Create(); //I don't remeber the options of the top of my head.
dlg->ShowWindow(SW_SHOW);
}
CChildDlg::OnOk()
{
((CMainDlg *)m_pParent)->SaveData(data);
}
CMainDlg::SaveData(CString data)
{
DataListCtrl.InsertItem(0,data);
}
The m_pParent is a pointer to CMainDlg. This is copied from the CChildDlg constructor. The constructor accepts the CWnd if it is passed.
Please let me know if I am not giving you enough information. I can post my actual code in a few hours when I get home.
BTW: This is MSVC6.
Edit:
I have stepped through the code. I get into SaveData fine. When I attempt to access the CListCtrl It complains that is does not have a valid m_hWnd.