www.pudn.com > NoteBookVC++.rar > GAME.cpp


// GAME.cpp: implementation of the GAME class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "记事本.h" 
#include "GAME.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
GAME::GAME() 
{ 
 
	GAME::MusicRecycle=MF_CHECKED; 
	GAME::EditFileName="无标题.txt"; 
	GAME::CheckText.Format(""); 
	GAME::HelpDat.Format(""); 
	GAME::FindStr.Format(""); 
	GAME::FindStr.Format(""); 
	GAME::ReplacdStr.Format(""); 
	FindReplace=NULL; 
    FindResult=-1; 
	AutoSave=TRUE; 
	AutoSaveTime=300; 
} 
 
GAME::~GAME() 
{ 
if (FindReplace!=NULL) 
delete FindReplace; 
} 
 
BOOL GAME::CheckSaveFile(CString SaveFileName) 
{ 
        CFile SaveFile; 
		CFileStatus Status; 
		SaveFile.GetStatus(SaveFileName,Status); 
		BOOL result=FALSE; 
		switch(Status.m_attribute) 
		{ 
		case 0x00: 
		case 0x20: 
			result=TRUE; 
			break; 
        case 0x01: 
		case 0x21: 
             AfxGetApp()->GetMainWnd()->MessageBox("保存失败,该文件是只读文件 !","保存文件",MB_ICONEXCLAMATION); 
			 break; 
		case 0x02: 
		case 0x03: 
		case 0x22: 
		case 0x23: 
             AfxGetApp()->GetMainWnd()->MessageBox("保存失败,该文件是隐藏文件 !","保存文件",MB_ICONEXCLAMATION); 
			break; 
		case 0x04: 
		case 0x06: 
		case 0x07: 
		case 0x24: 
		case 0x26: 
		case 0x27: 
             AfxGetApp()->GetMainWnd()->MessageBox("保存失败,该文件是系统文件 !","保存文件",MB_ICONEXCLAMATION); 
			break; 
		default: 
			break; 
		} 
			return result; 
		 
}