在VC里面是处理应用程序类的INITSTANCE
BOOL CSdfdsApp::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.
..........
//分析命令行
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
//结束
........
}
为了能够处理命令行,您可从CCommandLineInfo 派生,
例如:
void ParseParam(const TCHAR* pszParam,Bool Flag,Bool blast*)
{
CString sArg(pszParam);
if(bFlag)
m_bDialogFg=!sArg.CompareNoCase("yours command eg d");//d
CCommandLineInfo:
arseParam(pszParam,bFlag,blast);//其中m_bDialogFg为自定义的变量!
}
然后将相应的应用程序里调用ParseParam(const TCHAR* pszParam,Bool Flag,Bool blast*)
就OK了!
}