📄 test6doc.cpp
字号:
// test6Doc.cpp : implementation of Ctest6Doc
//
#include "StdAfx.h"
#include "Resource.h"
#include "test6.h"
#include "test6Doc.h"
#include "test6View.h"
#include "Htest6Model.h"
#include "HUtility.h"
#include "HUtilityLocaleString.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Ctest6Doc
IMPLEMENT_DYNCREATE(Ctest6Doc, CHoopsDoc)
BEGIN_MESSAGE_MAP(Ctest6Doc, CHoopsDoc)
//{{AFX_MSG_MAP(Ctest6Doc)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Ctest6Doc::Ctest6Doc()
{
m_pHoopsModel = 0;
}
Ctest6Doc::~Ctest6Doc()
{
if (m_pHoopsModel)
{
delete m_pHoopsModel;
m_pHoopsModel = 0;
}
}
// user has created a new document
BOOL Ctest6Doc::OnNewDocument()
{
if (!CHoopsDoc::OnNewDocument())
return FALSE;
// delete the Htest6View object if there is already one
POSITION pos = GetFirstViewPosition();
Ctest6View *pView = (Ctest6View*)GetNextView(pos);
if( pView )
pView->CleanUp();
// delete the Htest6Model object if there is already one
if(m_pHoopsModel)
{
delete m_pHoopsModel;
m_pHoopsModel = NULL;
}
// create a new Htest6Model object for this Document
m_pHoopsModel = new Htest6Model();
m_pHoopsModel->Init();
if (!m_pHoopsModel)
return FALSE;
return TRUE;
}
BOOL Ctest6Doc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CHoopsDoc::OnOpenDocument(lpszPathName))
return FALSE;
// delete the Htest6View object if there is already one
POSITION pos = GetFirstViewPosition();
Ctest6View *pView = (Ctest6View*)GetNextView(pos);
if( pView )
pView->CleanUp();
// delete the Htest6Model object if there is already one
if(m_pHoopsModel)
{
delete m_pHoopsModel;
m_pHoopsModel = NULL;
}
// create a new Htest6Model object for this Document
m_pHoopsModel = new Htest6Model();
m_pHoopsModel->Init();
if (((Htest6Model *)m_pHoopsModel)->Read(H_ASCII_TEXT(lpszPathName)) != InputOK)
return FALSE;
return TRUE;
}
BOOL Ctest6Doc::OnSaveDocument(LPCTSTR lpszPathName)
{
// TODO: Add your specialized code here and/or call the base class
return CHoopsDoc::OnSaveDocument(lpszPathName);
}
/////////////////////////////////////////////////////////////////////////////
// Ctest6Doc diagnostics
#ifdef _DEBUG
void Ctest6Doc::AssertValid() const
{
CHoopsDoc::AssertValid();
}
void Ctest6Doc::Dump(CDumpContext& dc) const
{
CHoopsDoc::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// Ctest6Doc serialization
void Ctest6Doc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -