GetParentForm...如果没记错的话。

解决方案 »

  1.   

    可是我在主对话框中定义:
    public:
    CString m_strTest;
    在打开的模式对话框的OnInitDialog()中:
    CString strTest;
    strTest = GetParent()->m_strTest;
    则编译错:'m_strTest' : is not a member of 'CWnd'
    我想实现这样的功能该怎么办呢?
      

  2.   

    那是编译器的报怨,强制转化就没事.
    假定你的Parent是CParentDlg类CParentDlg *pDlg=(CParentDlg*)GetParent();
    ASSERT_KINDOF(CParentDlg,pDlg);
    strTest=pDlg->m_strTest;