www.pudn.com > ±ÏÒµÁôÄî²á.rar > BYDDoc.cpp


// BYDDoc.cpp : implementation of the CBYDDoc class 
// 
 
#include "stdafx.h" 
#include "BYD.h" 
 
#include "BYDDoc.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CBYDDoc 
 
IMPLEMENT_DYNCREATE(CBYDDoc, CDocument) 
 
BEGIN_MESSAGE_MAP(CBYDDoc, CDocument) 
	//{{AFX_MSG_MAP(CBYDDoc) 
	ON_BN_CLICKED(ID_FILE_OPEN, OnFileOpen) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CBYDDoc construction/destruction 
 
CBYDDoc::CBYDDoc() 
{ 
	// TODO: add one-time construction code here 
 
} 
 
CBYDDoc::~CBYDDoc() 
{ 
} 
 
BOOL CBYDDoc::OnNewDocument() 
{ 
	if (!CDocument::OnNewDocument()) 
		return FALSE; 
 
	// TODO: add reinitialization code here 
	// (SDI documents will reuse this document) 
 
	return TRUE; 
} 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CBYDDoc serialization 
 
void CBYDDoc::Serialize(CArchive& ar) 
{ 
	if (ar.IsStoring()) 
	{ 
		 
		// TODO: add storing code here 
	} 
	else 
	{ 
		// TODO: add loading code here 
	} 
	m_Classe.Serialize(ar); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CBYDDoc diagnostics 
 
#ifdef _DEBUG 
void CBYDDoc::AssertValid() const 
{ 
	CDocument::AssertValid(); 
} 
 
void CBYDDoc::Dump(CDumpContext& dc) const 
{ 
	CDocument::Dump(dc); 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CBYDDoc commands 
 
void CBYDDoc::OnFileOpen()  
{ 
	CString m_filename; 
	CString lpszFilter="±ÏÒµ¼ÍÄî²á(*.atao)|*.atao||"; 
	CFileDialog fdlg(TRUE,NULL,NULL,NULL,lpszFilter,NULL);  
	char array[MAX_PATH];  
	 
	if(fdlg.DoModal()==IDOK) 
	{ 
		m_filename=fdlg.GetFileName(); 
		 
		strcpy(array, fdlg.GetPathName());  
		array[strlen(array) + 1] = 0;  
		 
		CDocument::OnOpenDocument(array); 
	}	 
	 
}