🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #2381

Re: Help using DosStartSession and error status (please)

#2381
From: Alan Ballard
Date: Wed, 30 Jan 1991 07:04
42 lines
2281 bytes
In article <Jan.28.21.54.02.1991.6554@pilot.njin.net> gould@pilot.njin.net (Brian Jay Gould) writes:
>In the past I've use DosExecPgm to start another program, but now
>I need to keep it as a child process.  
>I'm getting a status return of 4367 and can't find any information
>on it in any documentation.  Any help?

This doesn't seem to be a valid error code according to the header files. 
Are you sure you're displaying it correctly?

The following is a fragment of code that provides a simple 
example of the use of DosStartSession.
 
/*
 * Start the specified program as a separate, unrelated, background
 * session. 
 *
 * Parameters are name of program, which must include extension and must
 * either be in the search path or include fully specified path, and
 * argument string to pass to it.  Argument string may be specified as 
 * NULL, otherwise it a single 0-terminated string constituting the 
 * "tail" of a command line for the program.
 */
void FAR
StartSession(NPSZ npszName, PSZ pszArgs)
   STARTDATA       stdata;
   USHORT          idSession;
   int             rc;

   WtiLFillStruct(&stdata, sizeof(stdata), 0);  /* zero-fill the struct */
   stdata.Related = FALSE;
   stdata.Length = sizeof(stdata);
   stdata.FgBg = TRUE;
   stdata.PgmName = npszName;
   stdata.PgmInputs = pszArgs;

   if (rc = DosStartSession(&stdata, &idSession, &pid)) 
      fprintf(stderr, "rc=%d from DosStartSession\n", rc);
}
Alan Ballard                   | Internet: ballard@ucs.ubc.ca
University Computing Services  |   Bitnet: USERAB1@UBCMTSG
University of British Columbia |    Phone: 604-228-3074
Vancouver B.C. Canada V6R 1W5  |      Fax: 604-228-5116
Technical Details
Message-ID: <1991Jan30.070439.11580@unixg.ubc.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!van-bc!ubc-cs!unixg.ubc.ca!cheddar.ucs.ubc.ca!ballard
References: <Jan.28.21.54.02.1991.6554@pilot.njin.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!van-bc!ubc-cs!unixg.ubc.ca!cheddar.ucs.ubc.ca!ballard
From: ballard@cheddar.ucs.ubc.ca (Alan Ballard)
Newsgroups: comp.os.os2.programmer
Subject: Re: Help using DosStartSession and error status (please)
Keywords: DosStartSession error
Message-ID: <1991Jan30.070439.11580@unixg.ubc.ca>
Date: 30 Jan 91 07:04:39 GMT
References: <Jan.28.21.54.02.1991.6554@pilot.njin.net>
Sender: news@unixg.ubc.ca (Usenet News Maintenance)
Organization: Computing Services, University of British Columbia
Lines: 42