16,471
社区成员
发帖
与我相关
我的任务
分享
CRightView* CXXDoc::GetView()
{
// find the first view - if there are no views
// we must return NULL
POSITION pos = GetFirstViewPosition();
if (pos == NULL)
return NULL;
// find the first view that is a CRichEditView
CView* pView;
while (pos != NULL)
{
pView = GetNextView(pos);
if (pView->IsKindOf(RUNTIME_CLASS(CRightView)))
return (CRightView*) pView;
}
// can't find one--return NULL
return NULL;
}
CDRConsoleDEMO1Doc* CImageView::GetDocument() const// 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDRConsoleDEMO1Doc)));
return (CDRConsoleDEMO1Doc*)m_pDocument;
}
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CXXDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CXXView));