Article View: borland.public.cppbuilder.nativeapi
Article #12884Re: Wait for a CreateProcess spawned application to terminate...
From: Ed Mulroy [TeamB]
Date: Wed, 12 Nov 2003 02:10
Date: Wed, 12 Nov 2003 02:10
37 lines
2436 bytes
2436 bytes
Code to do that and a description are here: bcbdev.com FAQ's #71 Launch another program http://www.bcbdev.com/faqs/faq71.htm . Ed > Conny H�kansson wrote in message > news:3fb19517@newsgroups.borland.com... > > 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???
Technical Details
Message-ID:
<3fb1968c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.he.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3fb19517@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,aeafaa878f9b7ab6 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-11 18:21:45 PST From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fb19517@newsgroups.borland.com> Subject: Re: Wait for a CreateProcess spawned application to terminate... Date: Tue, 11 Nov 2003 21:10:10 -0500 Lines: 39 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.1106 NNTP-Posting-Host: 24.74.175.102 Message-ID: <3fb1968c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1068603020 24.74.175.102 (11 Nov 2003 18:10:20 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.he.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail