Process Manager Class
![]() | OnExecError ( int nErrorCode, const CString & strCommand ) Error handler |
Process Manager Class. The class makes it easy to start and switch processes in a Win32 environment. One of the main goals of this class is its ability to handle complex command strings. A command string has the following syntax (BNF-like):CmdLine : command | command arguments | 'cd' directory ';' command | 'cd' directory ';' command arguments command : string arguments: string | arguments string directory: string // shall consist of a full path ! string : '[^ \t]+' // string without blanks/tabs | '"' '[^"]*' '"' // quoted string can // contain any character // except " itselfFor those programmers who are not familiar with BNF-notation here are some samples for valid command strings:cmd cmd /c dir cd C:\windows ; cmd /c dir cd "C:\Program Files\Informix" ; cmd /c dir cd "C:\Program Files\Pictures" ; "\\picard\Software\Graphic Utilities\PSP\psp.exe" Title.jpgNote that you have to double all occurencies of '\' in C/C++ source code!
ParseCommand() returns TRUE, if <CmdLine> is syntactical
correct and FALSE if not. It does not check whether
<directory> or <command> are valid!
virtual ~CProcessMgr()
BOOL ParseCommand( const CString & CmdLine, CString & Directory, CString & Cmd, CString & Args )
DWORD Execute( const CString & strCmd, const CString & strArgs, const CString & strDir = "", BOOL bWait = FALSE )
DWORD Execute(const CString & strCmdLine, BOOL bWait = FALSE)
DWORD Wait(DWORD PID)
DWORD IsProgramRunning(const CString & FileName)
DWORD IsProgramRunning(DWORD PID)
BOOL SwitchProcessIntoForeground(DWORD dwPID)
BOOL SwitchProcessIntoForeground( const CString & FileName )
BOOL GetLinkInfo(const CString & LinkName, CString & Path)
Path - buffer for the path, the link points to virtual void OnExecError( int nErrorCode, const CString & strCommand )
strCommand - the command that caused the error LEXER LexCommand(CString & strToken)
BOOL GetErrorText(int nError, CString & strErrText)
strErrText - buffer for the descriptive text
generated by doc++