www.pudn.com > no4scr.rar > NO_4.cpp


// NO_4.cpp : Defines the class behaviors for the application. 
// 
 
#include "stdafx.h" 
#include "NO_4.h" 
#include "NO_4Dlg.h" 
 
#include "ScrSaverWnd.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CNO_4App 
 
BEGIN_MESSAGE_MAP(CNO_4App, CWinApp) 
	//{{AFX_MSG_MAP(CNO_4App) 
		// NOTE - the ClassWizard will add and remove mapping macros here. 
		//    DO NOT EDIT what you see in these blocks of generated code! 
	//}}AFX_MSG 
	ON_COMMAND(ID_HELP, CWinApp::OnHelp) 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CNO_4App construction 
 
CNO_4App::CNO_4App() 
{ 
	// TODO: add construction code here, 
	// Place all significant initialization in InitInstance 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// The one and only CNO_4App object 
 
CNO_4App theApp; 
 
///////////////////////////////////////////////////////////////////////////// 
// CNO_4App initialization 
 
 
BOOL CNO_4App::InitInstance() 
{ 
	AfxEnableControlContainer(); 
 
	// Standard initialization 
	// If you are not using these features and wish to reduce the size 
	//  of your final executable, you should remove from the following 
	//  the specific initialization routines you do not need. 
 
#ifdef _AFXDLL 
	Enable3dControls();			// Call this when using MFC in a shared DLL 
#else 
	Enable3dControlsStatic();	// Call this when linking to MFC statically 
#endif 
 
 
	CScrSaverWnd* pWnd=new CScrSaverWnd; 
	CNO_4Dlg dlg; 
	m_pMainWnd = &dlg; 
 
	char *u;					//外部参数 
 
	if (__argc != 2)			//n个参数argc=n+1 
		return FALSE; 
 
	u=_T(__argv[1]+1);			//小心登录违例 
								// u=提取指令 
	if (*u=='c') 
		if (dlg.DoModal() == IDOK) 
		{ 
			// TODO: Place code here to handle when the dialog is 
			//  dismissed with OK 
		} 
		else if (dlg.DoModal() == IDCANCEL) 
		{ 
			// TODO: Place code here to handle when the dialog is 
			//  dismissed with Cancel 
		} 
 
	if (*u=='p') 
		::AfxMessageBox (_T("Matrix")); 
	if (*u=='s'||*u=='S') 
	{ 
		pWnd->Create(); 
		m_pMainWnd=pWnd; 
		return TRUE; 
	} 
 
 
 
	// Since the dialog has been closed, return FALSE so that we exit the 
	//  application, rather than start the application's message pump. 
	return FALSE; 
}