返回控件视区窗口, 为空取当前句柄
static CWnd* GetMxDrawView(MXDRAWOCXHANDLE handle = NULL);
参数 |
说明 |
MXDRAWOCXHANDLE handle = NULL |
控件名柄 |
返回控件视区窗口
很多时候需要控件视区窗口指针,比如下面代码是得到控件的视区窗口,然后再得到视区的显示范围 例如:
CWnd* pWnd = MxDraw::GetMxDrawView(m_hOcx); ASSERT(pWnd != NULL); CRect rect; pWnd->GetClientRect(&rect); CPoint pt = rect.BottomRight(); //ptmin,ptmax就是显示的文档范围 McGePoint3d ptmin = MxDraw::ViewToDocCoord(m_hDrawOcx,pt); pt = rect.TopLeft(); McGePoint3d ptmax = MxDraw::ViewToDocCoord(m_hDrawOcx,pt);