对话框与View类之间的传值出问题!!!!!!!!
利用指针已经将dlg中m的值传给了view中的变量n,但是在运行用但不跟踪检查时n的值时,他的值竟然是-842150451,为什么会这样呢????
我定义的是int n!!!!!!!
我知道为什么?????
请高手指教!!!!!!!!!
谢谢!!!!!!!!
谢谢!!!!!!!!!!!!
[解决办法]
eg
MainFrm.h
CView1 m_pView1;
CView2 m_pView2;
CView3 m_pView3;
//*************************************************
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CView1),CSize(0,0),pContext);
m_pView1=(CView1*)m_wndSplitter.GetPane(0,0);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CView2),CSize(0,0),pContext);
m_pView2=(CView2*)m_wndSplitter.GetPane(0,1);
m_wndSplitter.CreateView(0,2,RUNTIME_CLASS(CView3),CSize(0,0),pContext);
m_pView3=(CView3*)m_wndSplitter.GetPane(0,2);
}