www.pudn.com > julei.rar > juleiDoc.cpp


// juleiDoc.cpp : implementation of the CJuleiDoc class 
// 
 
#include "stdafx.h" 
#include "julei.h" 
 
#include "juleiDoc.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CJuleiDoc 
 
IMPLEMENT_DYNCREATE(CJuleiDoc, CDocument) 
 
BEGIN_MESSAGE_MAP(CJuleiDoc, CDocument) 
	//{{AFX_MSG_MAP(CJuleiDoc) 
	ON_COMMAND(IDM_SHOW, OnShow) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CJuleiDoc construction/destruction 
 
CJuleiDoc::CJuleiDoc() 
{ 
	// TODO: add one-time construction code here 
 
} 
 
CJuleiDoc::~CJuleiDoc() 
{ 
} 
 
BOOL CJuleiDoc::OnNewDocument() 
{ 
	if (!CDocument::OnNewDocument()) 
		return FALSE; 
 
	// TODO: add reinitialization code here 
	// (SDI documents will reuse this document) 
 
	return TRUE; 
} 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CJuleiDoc serialization 
 
void CJuleiDoc::Serialize(CArchive& ar) 
{ 
	if (ar.IsStoring()) 
	{ 
		// TODO: add storing code here 
	} 
	else 
	{ 
		// TODO: add loading code here 
	} 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CJuleiDoc diagnostics 
 
#ifdef _DEBUG 
void CJuleiDoc::AssertValid() const 
{ 
	CDocument::AssertValid(); 
} 
 
void CJuleiDoc::Dump(CDumpContext& dc) const 
{ 
	CDocument::Dump(dc); 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CJuleiDoc commands 
 
void CJuleiDoc::OnShow()  
{ 
	// TODO: Add your command handler code here 
	char ProgramPath[70]; 
	memset(ProgramPath,'\0',70); 
	GetEnvironmentVariable("ProgramFiles",ProgramPath,40); 
	memcpy(ProgramPath+strlen(ProgramPath),"\\Windows NT\\Accessories\\wordpad.exe result.txt", 
		strlen("\\Windows NT\\Accessories\\wordpad.exe result.txt")); 
 
	if(31 > WinExec(ProgramPath,SW_SHOWMAXIMIZED)) 
	{ 
		ShellExecute(NULL,"open","result.txt",NULL,NULL,SW_SHOWMAXIMIZED); 
	} 
}