viksoe.dk

CExecProg class


This article was submitted .


A small MFC class that wraps the Windows CreateProcess() API.

This list of strange arguments needed for the CreateProcess() is long, so to do it right you always need to look up the documentation. This wrapper class promotes simple use of the CreateProcess() function - with simple constructors and default argument values. It also supports waiting for process termination.

Interface

 NameDescription
StartProgramLaunch application w. wait option.
OpenProcessLanch application.
GetLastErrorGet last error code.
WaitForTerminationWait for process termination.
CheckForTerminationHas the process termianted.
ReleaseProcessInfoRelease information.
ShellProgramUse ShellExecute to launch application.
IsExecutableIs filename an executable?

Notes

The use of the much more simple WinExec() function, is not recommended by Microsoft because it is marked obsolete.

Source Code Dependencies

Microsoft MFC Library
My Global MFC functions

Download Files

DownloadSource Code (5 Kb)

To the top