Article View: borland.public.cppbuilder.nativeapi
Article #10975Reading from a console without using a physical file
From: Jay McVinney
Date: Tue, 09 Mar 2004 03:36
Date: Tue, 09 Mar 2004 03:36
21 lines
1832 bytes
1832 bytes
Hi again, Yet another question that must be so self-evident that it is not documented anywhere that I've looked. I need to run a third-party program that is a console application. This application drops it's output into stdout, just like any other dos utility. Unfortunately I am not seeing any way to read this output directly without having to create a physical file using redirection and then going back with my application and reading that file. I suppose my question is "How do you call a console application and retrieve the output without using file redirection?". An example of what I am trying to accomplish would be to run "dir" (I'm using CreateProcess() to execute the command) and retrieve the output into a char[] *buffer or String without any disk I/O. Every example I find that seems close turns out to be writing TO the console rather than FROM the console. Any suggestions? Jay McVinney
Technical Details
Message-ID:
<404d3bcd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2baf93b15a7cd73f,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-08 19:40:35 PST Reply-To: "Jay McVinney" <compforce@nospam.hotmail.com> From: "Jay McVinney" <compforce@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Reading from a console without using a physical file Date: Mon, 8 Mar 2004 22:36:53 -0500 Lines: 23 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: 24.196.229.31 Message-ID: <404d3bcd$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1078803405 24.196.229.31 (8 Mar 2004 19:36:45 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail