One possible cause of error 19 is that the string you passed to specify
$STDLIST is not terminated by a carriage return.
-------
successfully call the CREATEPROCESS intrinsic
from C/XL and redirect $STDLIST to a flat ascii file?
Some pointers appear below:
1) The $STDLIST flat ascii file should be built before calling the
CREATEPROCESS intrinsic (either before running the program, or
through the COMMAND intrinsic);
2) Calling the CREATEPROCESS intrinsic requires that the program
have PH (process handling) capability. You can compile and
link as follows to obtain this capability:
:CCXL MYSOURCE
:LINK FROM=$OLDPASS;TO=MYPROG;RL=^CCSTDRL.LIB.SYS;CAP=IA,BA,PH
3) The string containing the $STDLIST filename should be terminated
with the octal equivalent of a carriage return, which is
expressed as "\015" in C/XL.
4) The address of the character array containing the filename of
the $STDLIST file must be type-coerced to an integer value.
For example, if the filename is contained in the character array
"stdlist", you can type-coerce the address of this array to
an integer value with "(int) stdlist".
A sample program follows that calls CREATEPROCESS to activate EDITOR and
redirect $STDLIST to the flat ascii file OUTFILE. You build the file
OUTFILE with the command ":BUILD OUTFILE;REC=-80,,F,ASCII;DISC=1000",
and remember that the program must have PH capability. For further
information on CREATEPROCESS, see the MPE XL Intrinsics Reference Manual
(part no. 32650-90028).
#include <stdio.h>
#include <mpe.h>
#pragma intrinsic CREATEPROCESS createprocess
main ()
{
int status;
short int pin;
char progname[29];
char stdlist[19];
int itemnums[4];
int items[3];
printf("Calling CREATEPROCESS intrinsic...\n\n");
strcpy(progname,"EDITOR.PUB.SYS ");
strcpy(stdlist,"OUTFILE\015"); /* must terminate filename with
a carriage return */
itemnums[0] = 3; /* load options */
items[0] = 1; /* reactivate PARENT when SON terminates */
itemnums[1] = 10; /* call ACTIVATE intrinsic for SON process */
items[1] = 2; /* specify SON activation */
itemnums[2] = 9; /* option to redirect $STDLIST */
items[2] = (int) stdlist; /* address of $STDLIST variable name,
type-coerced to an integer */
itemnums[3] = 0;
createprocess ( &status, &pin, progname, itemnums, items );
if (status!=0) printf ("\nCREATEPROCESS failure, status is %d\n",
status);
else printf ("\nFATHER re-activated... successful call!\n");
}
hope this helps
Cathlene Mc Rae
Sr Response Center Engineer.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|