🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Displaying stdout in dos box

#13047
From: Bob Gonder
Date: Fri, 31 Oct 2003 17:15
37 lines
2635 bytes
Denville Longhurst wrote:

>The problem is that the diagnostic message which my app displays (and logs)
>prior to closing is lost as soon as it closes.  What I am trying to
>replicate is a scheme where I can copy the essential message(s) back to the
>DOS console so that an observer can still reas them in the DOS box even
>after my app has closed and the contingency app has run up.

You could write messages to a text file, and have the batch then type
the text file. (delete it on startup)

>I do not agree that GUI processes do not use STDOUT.  If I place a

The Command Interpreter (CI)  doesn't _normally_ set up stdout for gui
apps.

> However, if I call the app with something like MYAPP >MYFILE the stdout is 

Yes, because the CI is setting up a pipe prior to CreateProcess().

>  I am tempted to write a MORE - like utility to achieve what I want but this seem overkill if there
>is a simpler way.

That should be a very short & easy program.

>So, the basic question is: How, from within a GUI applicatiuon running in a
>DOS box, can I write text to that DOS box.

If you reliably know the name of the Command Console, you could get
it's hWnd, then maybe use WM_PASTE
Hmm... There's a TITLE function that would set the name reliably....

Then again, I don't think there's anything stopping you from creating
a "console app" (runs in the "DOS box") that then creates threads that
run the gui portion.  
You'd replace WinMain with main(), but the code inside WinMain should
be pretty much the same. CreateWindow, message pump, etc.
Technical Details
Message-ID: <cd45qvsqhk5hs5negqag3qd7c49ebtm1lc@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f9fe982@newsgroups.borland.com> <3f9ffb90$1@newsgroups.borland.com> <3fa23451$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e00744b422e64f48
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-31 09:39:50 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Displaying stdout in dos box
Date: Fri, 31 Oct 2003 09:15:12 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <cd45qvsqhk5hs5negqag3qd7c49ebtm1lc@4ax.com>
References: <3f9fe982@newsgroups.borland.com> <3f9ffb90$1@newsgroups.borland.com> <3fa23451$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.164.194
X-Trace: newsgroups.borland.com 1067620515 67.31.164.194 (31 Oct 2003 09:15:15 -0700)
Lines: 40
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail