窗口拆分的问题
我在CMainFrame中写了下面
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
CRect cr;
GetWindowRect( &cr );
if (!m_mainSplitter.CreateStatic(this,1,2))
{
return FALSE;
}
m_mainSplitter.CreateView(0,0,RUNTIME_CLASS(CView1),CSize(400,400),pContext);
m_View2 = m_mainSplitter.CreateView(0,1,RUNTIME_CLASS(CView2),CSize(cr.Width()/2-400, cr.Height()-400),pContext);
return TRUE;
}
现在我想在CView1类(左边的)的StartDraw()函数中,得到view1的区域,也就是说得到左边的区域应该怎么做? 我在CView1中看this指针(不在OnPaint中)好像是不是指向左边的区域,不知道指哪去了。 我应该怎么做?
PS:不能在OnPaint()中用用CPaintDC dc(this);