複製鏈接
請複製以下鏈接發送給好友

RunAutomated

鎖定
RunAutomated,確定是否出現了“/Automation”或“-Automation”選項,這指明服務器程序是否是由客户應用程序啓動的。
外文名
RunAutomated
CWinApp
頭文件
afxwin.h
語    法
BOOL RunAutomated();

目錄

RunAutomated基本介紹

類: CWinApp
頭文件:
afxwin.h
功能:
語法:
BOOL RunAutomated(); [1] 
返回值:
如果函數找到了該選項,則返回非零值;否則返回零。
説明:
如果出現了“/Automation”或“-Automation”選項,則從命令行中清楚這個選項。

RunAutomated示例

/***********************************************************************
演示函數原型:theApp->RunAutomated();
程序功能説明:判斷是否出現了“/Automation”或“-Automation”選項而執行程序。
***********************************************************************/
//一段例程
class CTestApp : public CWinApp
{  public:  CTestApp( );
CString str;//添加的對話框變量
...  }
CTestApp *theApp=(CTestApp *)AfxGetApp( );
//判斷是否有Automation選項而執行程序
if(BOOL HR=theApp->RunAutomated())
theApp->str="函數找到了該選項";
else
theApp->str="NULL";
AfxMessageBox(theApp->str);
參考資料
  • 1.    MSDN windows高級編程指南