Category : Files from Magazines
Archive   : WDFEB92.ZIP
Filename : 3N02052A
// cl /AL /Lp execpgm.c
// bind286 execpgm
// execpgm
// execpgm.c - Example program to show how DosExecPgm is used to create
// a new process. This program starts CHILD.EXE as a new process.
// By having this program print "P" and "CHILD.EXE" print "C", it is
// possible to see how the execution of both processes is switched.
extern unsigned far pascal DosExecPgm
(
char far *, //BYTES output ->FailObjName
unsigned, //WORD input FailObjNameLen
unsigned, //WORD input ExecType
char far *, //ASCIIZS input ->Arg
char far *, //ASCZIIS input ->Env
struct RetInfo far *, //DWORD output ->RetInfo
char far * //ASCIIZ input ->PgmName
);
struct RetInfo
{
unsigned TermCode;
unsigned RetCode ;
};
#define ExecType 1
#define PGM "child.exe"
#define NMSG 1800
unsigned far pascal DosSleep(unsigned long);
main()
{
struct RetInfo ChildInfo;
int i;
printf("parent Started ");
DosExecPgm(0l,0,ExecType,0l,0l,&ChildInfo,PGM);
for (i = 1; i <=NMSG; i++){
printf("P");
DosSleep(0);
}
printf(" parent ended ");
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/