🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12881

Wait for a CreateProcess spawned application to terminate...

#12881
From: Conny H�kansson
Date: Wed, 12 Nov 2003 02:04
26 lines
2056 bytes
Yo!

Im currently using CreateProcess to spawn an external application.
The application does this several times in a loop that reads info from a
file.
foreach line read, the application is to spawn an external application
togheter with the info read from the file.
Now, this has to be done in an orderly fashion, that is, i have to be sure
that the first call to CreateProcess has finished before i call it again.

The CreateProcess is terrible, in the aspect that its quite complex compared
to old fashioned WinExec.
But i hope the additional functionality to control what is spawned
compensate for the increased complexity.

So now im trying to figure out how to asure myself that the spawn
application has terminated, before continuing with the next process. I was
loo�king in the PROCESS_INFORMATION structure, but im not sure i f i can use
any of those for checking the lifetmie of the process that is spawned.
I guess that the Handles and ProcessIds will remain the value, and jsut
become invalid as far as the OS is concerned. So checking them for a zero
value would be meaningless, right???

So how would a professional solve this???

/C
Technical Details
Message-ID: <3fb19517@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10cc67,aeafaa878f9b7ab6,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-11-11 18:09:25 PST
From: "Conny H�kansson" <conny@allimac.se>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Wait for a CreateProcess spawned application to terminate...
Date: Wed, 12 Nov 2003 03:04:03 +0100
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 217.215.164.250
Message-ID: <3fb19517@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1068602647 217.215.164.250 (11 Nov 2003 18:04:07 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail