我在createClient的函数中:
if(!m_wndSplitter1.CreateStatic(this,1,2))
return false;
if(!m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CLeftView),CSize(300,0),pContext))
return false;
if(!m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD ¦WS_VISIBLE,m_wndSplitter1.IdFromRowCol(0,1)))
return false;
if(!m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CClientView),CSize(0,150),pContext) ¦ ¦
!m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CView3),CSize(0,0),pContext))
return false;
在CClientView的成员函数中:
CMainFrame *pframe = (CMainFrame *)AfxGetApp()- >m_pMainWnd;
if(pframe==NULL)
return;
CView3 *pview = (CView3 *)pframe- >m_wndSplitter2.GetPane(1,0);
编译可以通过,但是最后一句总是在调试中出现问题,请各位高手帮帮忙!小弟谢谢啦!!
if(!m_wndSplitter1.CreateStatic(this,1,2))
return false;
if(!m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CLeftView),CSize(300,0),pContext))
return false;
if(!m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD ¦WS_VISIBLE,m_wndSplitter1.IdFromRowCol(0,1)))
return false;
if(!m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CClientView),CSize(0,150),pContext) ¦ ¦
!m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CView3),CSize(0,0),pContext))
return false;
在CClientView的成员函数中:
CMainFrame *pframe = (CMainFrame *)AfxGetApp()- >m_pMainWnd;
if(pframe==NULL)
return;
CView3 *pview = (CView3 *)pframe- >m_wndSplitter2.GetPane(1,0);
编译可以通过,但是最后一句总是在调试中出现问题,请各位高手帮帮忙!小弟谢谢啦!!
应该是 m_pMainWnd==NULL吧
m_pMainWnd怎么会是空的呢jhs1982419?
你在成员函数上加个断点,再在createclient上加个断点,看看是不是先调用成员函数,后调用的createclient有可能在你调用的时候还没有创建呢。