www.pudn.com > 数控仿真与网络控制系统.rar > CCmdLineEx.cpp


#include "stdafx.h" 
#include "NoteXpad.h" 
#include "CmdLineEx.h" 
#include "stdio.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
CCmdLineEx::CCmdLineEx() 
{ 
	m_FlagTop = 0; 
	m_FlagLeft = 0; 
} 
 
CCmdLineEx::~CCmdLineEx() 
{ 
 
} 
 
void CCmdLineEx::ParseParam(const TCHAR* pszParam,BOOL bFlag,BOOL bLast) 
{ 
	if(pszParam[0] == 'x') 
	{ 
	 //Command line sent was for top and left placement of window. 
		  CString Arg(pszParam); 
		  Arg.Delete(0); 
		  int comma = Arg.Find(","); 
		  m_FlagLeft = atoi(Arg.Right(comma)); 
		  m_FlagTop = atoi(Arg.Left(comma)); 
		 
		  CWinApp* theApp = (CWinApp*)AfxGetApp(); 
		  theApp->WriteProfileInt("Settings","Left",m_FlagLeft); 
		  theApp->WriteProfileInt("Settings","Top",m_FlagTop); 
		  return; 
	} 
 
 
	 
	CCommandLineInfo::ParseParam(pszParam,bFlag,bLast); 
}