123456789101112131415161718192021222324252627282930313233343536373839 |
- // stdafx.cpp : 只包括标准包含文件的源文件
- // RvcWindowsInitial.pch 将作为预编译头
- // stdafx.obj 将包含预编译类型信息
- #include "stdafx.h"
- // TODO: 在 STDAFX.H 中
- // 引用任何所需的附加头文件,而不是在此文件中引用
- UINT SYSTEM_ON(CStringA cmdLine)
- {
- UINT result = 0;
- CStringA strCmd;
- strCmd.Format("cmd /c %s", cmdLine);
- #if 0
- result = system(strCmd.GetBuffer());
- return result;
- #else
- result = WinExec(strCmd, SW_HIDE);
- return result > 31 ? ERROR_SUCCESS : result + 31;
- #endif
- }
- UINT SYSTEM_ON(CStringW cmdLine)
- {
- UINT result = 0;
- CStringW strCmd;
- strCmd.Format(L"cmd /c %s", cmdLine);
- char tempCmd[2048];
- CStringToMultiByteW(strCmd, tempCmd, strCmd.GetLength() + 1);
- #if 0
- result = system(tempCmd);
- return result;
- #else
- result = WinExec(tempCmd, SW_HIDE);
- return result > 31 ? ERROR_SUCCESS : result + 31;
- #endif
- }
|