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


// BrowseDoc.cpp : implementation of the CBrowseDoc class 
// 
 
#include "stdafx.h" 
#include "Browse.h" 
 
#include "BrowseDoc.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CBrowseDoc 
 
IMPLEMENT_DYNCREATE(CBrowseDoc, CDocument) 
 
BEGIN_MESSAGE_MAP(CBrowseDoc, CDocument) 
	//{{AFX_MSG_MAP(CBrowseDoc) 
	ON_BN_CLICKED(ID_MFILE_OPEN, OnMfileOpen) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CBrowseDoc construction/destruction 
 
CBrowseDoc::CBrowseDoc() 
{ 
	// TODO: add one-time construction code here 
 
} 
 
CBrowseDoc::~CBrowseDoc() 
{ 
} 
 
BOOL CBrowseDoc::OnNewDocument() 
{ 
	if (!CDocument::OnNewDocument()) 
		return FALSE; 
 
	// TODO: add reinitialization code here 
	// (SDI documents will reuse this document) 
 
	return TRUE; 
} 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CBrowseDoc serialization 
 
void CBrowseDoc::Serialize(CArchive& ar) 
{ 
	if (ar.IsStoring()) 
	{ 
		// TODO: add storing code here 
	} 
	else 
	{ 
		// TODO: add loading code here 
	} 
	m_Classe.Serialize(ar); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CBrowseDoc diagnostics 
 
#ifdef _DEBUG 
void CBrowseDoc::AssertValid() const 
{ 
	CDocument::AssertValid(); 
} 
 
void CBrowseDoc::Dump(CDumpContext& dc) const 
{ 
	CDocument::Dump(dc); 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CBrowseDoc commands 
 
void CBrowseDoc::OnMfileOpen()  
{ 
	 
	CString m_filename; 
	CFileDialog fdlg(TRUE);  
	char array[1000];  
	 
	if(fdlg.DoModal()==IDOK) 
	{ 
		m_filename=fdlg.GetFileName(); 
		 
		strcpy(array, fdlg.GetPathName());  
		array[strlen(array) + 1] = 0;  
		 
		CDocument::OnOpenDocument(array); 
	}	 
	// TODO: Add your control notification handler code here 
	 
}