父窗体指针传给子窗体

 

//showDVSDlg.h

 

 CWnd *m_pParent;

 

//showDVSDlg.cpp

CShowDVSDlg::CShowDVSDlg(CWnd* pParent /*=NULL*/)
 : CDialog(CShowDVSDlg::IDD, pParent)
{
      m_pParent = pParent;
}

//调用父窗体的成员

void CShowDVSDlg::ShowTreeList()

{

     ............

      int nNum = ((CStateDlg1*)m_pParent)->m_CurrentCCSPIN & 0x0f;
}

 

//state1.cpp

//将父窗体指针传给子窗体 include showDvsDlg.h

m_pShowDVSDlg = new CShowDVSDlg(this);

posted on 2008-08-12 11:05  willlove  阅读(136)  评论(0)    收藏  举报

导航