cpp:
BOOLm_bCmdRet=FALSE;
InitInstance()中:
if((m_lpCmdLine[0] == _T('\0')) || (lstrcmp(m_lpCmdLine, _T("此为参数")) != 0)) // 参数
{
m_bCmdRet=TRUE;
}
else
m_bCmdRet=FALSE;
"m_lpCmdLine"为MFC afxwin.h封装的命令行参数变量
-----------------------------------------------------------------------------------------------------------------------------------------
Dlg.cpp:
externBOOLm_bCmdRet;
OnInitDialog()中:
if(m_bCmdRet)
{
EndDialog(0);
}
参数不正确无法正常运行
BOOLm_bCmdRet=FALSE;
InitInstance()中:
if((m_lpCmdLine[0] == _T('\0')) || (lstrcmp(m_lpCmdLine, _T("此为参数")) != 0)) // 参数
{
m_bCmdRet=TRUE;
}
else
m_bCmdRet=FALSE;
"m_lpCmdLine"为MFC afxwin.h封装的命令行参数变量
-----------------------------------------------------------------------------------------------------------------------------------------
Dlg.cpp:
externBOOLm_bCmdRet;
OnInitDialog()中:
if(m_bCmdRet)
{
EndDialog(0);
}
参数不正确无法正常运行