Lets a program run another program as a child process.

#define INCL_DOSPROCESS
#include <os2.h>

PCHAR           pObjname;   /*  Address of the buffer in which the name of the object that contributed to the failure of DosExecPgm is returned. */
LONG            cbObjname;  /*  Length, in bytes, of the buffer described by pObjname. */
ULONG           execFlag;   /*  Flag indicating how the program runs in relation to the requester, and whether execution is under conditions for debugging. */
PSZ             pArg;       /*  Address of the ASCIIZ argument strings passed to the program. */
PSZ             pEnv;       /*  Address of the ASCIIZ environment strings passed to the program. */
PRESULTCODES    pRes;       /*  Pointer to the RESULTCODES structure where the process ID, or the termination code and the result code indicating the reason for ending the child process is returned. */
PSZ             pName;      /*  Address of the name of the file that contains the program to be executed. */
APIRET          ulrc;       /*  Return Code. */

ulrc = DosExecPgm(pObjname, cbObjname, execFlag,
         pArg, pEnv, pRes, pName);


[Back] [Next]