首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

对话框与View类之间的传值出有关问题!

2012-01-16 
对话框与View类之间的传值出问题!!!!!!!!利用指针已经将dlg中m的值传给了view中的变量n,但是在运行用但不

对话框与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);

}

热点排行