}
ASSERT_KINDOF(CDocument, pDocument); AddDocument(pDocument); return pDocument; }
(2)CreateNewFrame(pDocument, NULL),产生框架和视图
CFrameWnd* CDocTemplate::CreateNewFrame(CDocument* pDoc, CFrameWnd* pOther)
{
if (pDoc != NULL) ASSERT_VALID(pDoc);
// create a frame wired to the specified document
ASSERT(m_nIDResource != 0); // must have a resource ID to load from CCreateContext context;
context.m_pCurrentFrame = pOther;