framedoc.cpp
来自「有关win32应用程序编程和wince应用程序编程的很全面」· C++ 代码 · 共 112 行
CPP
112 行
// frameDoc.cpp : implementation of the CFrameDoc class//#include "stdafx.h"#include "fiver.h"#include "frameDoc.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CFrameDocIMPLEMENT_DYNCREATE(CFrameDoc, CDocument)BEGIN_MESSAGE_MAP(CFrameDoc, CDocument) //{{AFX_MSG_MAP(CFrameDoc) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CFrameDoc construction/destructionCFrameDoc::CFrameDoc(){ // TODO: add one-time construction code here}CFrameDoc::~CFrameDoc(){}BOOL CFrameDoc::OnNewDocument(){ if (!CDocument::OnNewDocument()) return FALSE; // TODO: add reinitialization code here // (SDI documents will reuse this document) return TRUE;}/////////////////////////////////////////////////////////////////////////////// CFrameDoc serializationvoid CFrameDoc::Serialize(CArchive& ar){ if (ar.IsStoring()) { int i = 0; int n = AI.step; ar<<n; for(i = 0;i< n;i++) { ar<<AI.ChessRecord[i].nx; ar<<AI.ChessRecord[i].ny; ar<<AI.ChessRecord[i].style; } } else { int n; unsigned char nx,ny; int style; AI.NewGame(); ar>>n; AI.RecordStep = n; for (int i = 0;i < n;i++) { ar>>nx; ar>>ny; ar>>style; AI.ChessRecord[i].nx = nx; AI.ChessRecord[i].ny = ny; AI.ChessRecord[i].style = style?1:0; } }}/////////////////////////////////////////////////////////////////////////////// CFrameDoc diagnostics#ifdef _DEBUGvoid CFrameDoc::AssertValid() const{ CDocument::AssertValid();}void CFrameDoc::Dump(CDumpContext& dc) const{ CDocument::Dump(dc);}#endif //_DEBUG/////////////////////////////////////////////////////////////////////////////// CFrameDoc commandsCFiverAI* CFrameDoc::GetAI(){ return &AI;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?