Article View: borland.public.cppbuilder.nativeapi
Article #1249Re: How to run a Command in a progam and wait until finish?
From: Bob Gonder
Date: Sun, 23 Sep 2007 21:13
Date: Sun, 23 Sep 2007 21:13
15 lines
1521 bytes
1521 bytes
Michel Leunen wrote: > CreateProcess(NULL, "yourApp.exe", > NULL, NULL, 0, 0, NULL, NULL, > &siStartInfo, &piProcInfo); > > //Wait for your application to end > WaitForSingleObject(piProcInfo.hProcess,INFINITE); CloseHandle( piProcInfo.hProcess ); CloseHandle( piProcInfo.hThread ); Yes, that is the prefered method. Also available are the C spawn functions spawnl, spawnp, etc. spawnl( P_WAIT, filename, filename)
Technical Details
Message-ID:
<65ldf39tfhjtoddeh8cdblfgd8ac5os9oh@4ax.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.euro.net!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<op.ty303qdoewlac1@centrino> <46f6b8c3$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b7bfc196b0d38789 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: How to run a Command in a progam and wait until finish? Date: Sun, 23 Sep 2007 14:13:18 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <65ldf39tfhjtoddeh8cdblfgd8ac5os9oh@4ax.com> References: <op.ty303qdoewlac1@centrino> <46f6b8c3$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.77.146.190 X-Trace: newsgroups.borland.com 1190581996 67.77.146.190 (23 Sep 2007 14:13:16 -0700) Lines: 18 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.euro.net!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail