Article View: borland.public.cppbuilder.nativeapi
Article #14248Re: Redirect the output text of an external DOS program
From: Remy Lebeau (TeamB)
Date: Sat, 23 Aug 2003 19:37
Date: Sat, 23 Aug 2003 19:37
24 lines
1882 bytes
1882 bytes
"Zlika" <zlika_eseSTOPSPAM@hotmail.com> wrote in message news:3f470e12@newsgroups.borland.com... > I use the "ShellExecute" function to launch an external DOS > program from my application. I would like to redirect the > output text of the DOS program to a TMemo object within > my application. How can I do this? You need to use CreateProcess() instead. Then you can supply your own STDOUT and STDERR handles for the new process. Use CreatePipe() to create them, use GetStdHandle() to assign the default STDIN handle, and then use ReadFile() to read the pipe and put the data into your Memo as needed. Gambit --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03
Technical Details
Message-ID:
<3f47cee2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f470e12@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,4eee751a7aaf3f47 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-23 13:36:33 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f470e12@newsgroups.borland.com> Subject: Re: Redirect the output text of an external DOS program Date: Sat, 23 Aug 2003 12:37:25 -0700 Lines: 26 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: 207.175.226.26 Message-ID: <3f47cee2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1061670626 207.175.226.26 (23 Aug 2003 13:30:26 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail