GME  13
GmeDocTemplate.cpp
Go to the documentation of this file.
00001 
00002 #include "stdafx.h"
00003 #include "GmeDocTemplate.h"
00004 
00005 CGmeDocTemplate::CGmeDocTemplate(UINT nIDResource, CRuntimeClass* pDocClass,
00006         CRuntimeClass* pFrameClass, CRuntimeClass* pViewClass)
00007         : CMultiDocTemplate(nIDResource, pDocClass, pFrameClass, pViewClass)
00008 {
00009 }
00010 
00011 CDocument* CGmeDocTemplate::OpenDocumentFile(LPCTSTR /*lpszPathName*/, BOOL /*bMakeVisible*/)
00012 {
00013         CDocument* pDocument = CreateNewDocument();
00014         if (pDocument == NULL)
00015         {
00016                 TRACE0("CDocTemplate::CreateNewDocument returned NULL.\n");
00017                 AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);
00018                 return NULL;
00019         }
00020         ASSERT_VALID(pDocument);
00021 
00022         // keep the document alive without views
00023         pDocument->m_bAutoDelete = FALSE;
00024 
00025         SetDefaultTitle(pDocument);
00026 
00027         return pDocument;
00028 }
00029