๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: cout, printf

#12467
From: Bob Gonder
Date: Thu, 04 Dec 2003 18:59
29 lines
2172 bytes
dESFasado wrote:

>En Thu, 04 Dec 2003 08:33:04 -0800, Bob Gonder <notbg@notmindspring.invalid> escribi๏ฟฝ:
>
>> 1) You could write a console app instead of a gui one. (Change the
>> Target to console, start the program at main instead of WinMain.)
>
>mmmm I'm not getting this one.

Open BCB6.HLP (or BCB5.HLP for the free-command-line fellows).
In the Find tab, type
"Example of creating a console application"
Ignore the parts about creating/using a dll. The example tells you how
to create a console application, and shows cout being used.

>> 2) If you really want console output in a gui program, then you need
>> to create a console.
>>
>> AllocConsole()
>> stdin = GetStdHandle(STD_INPUT_HANDLE);
>> stdout = GetStdHandle(STD_OUTPUT_HANDLE);
>
>I've already do this but what about cout? cin? I've used sync_stdio something iobase member but none happended. (at least in the console hehe)

Does printf() work with the above code?
I would think if printf works, that cout would too.
I don't do C++ much, and consider streams too messy/fussy to bother
with. Others may know the magic incantations to get cout synced to the
new console.
Technical Details
Message-ID: <540vsvkok4mnu25e3gev0tgfjemqj1qd5j@4ax.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-mail
References: <oprznx7gmf3sxi43@localhost> <umnusvcv4h8ov9esm51jrb2kn602l7df46@4ax.com> <oprzn0stsm3sxi43@localhost>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10cc67,3b40ef498405c7c4
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-04 11:10:39 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: cout, printf
Date: Thu, 04 Dec 2003 10:59:21 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <540vsvkok4mnu25e3gev0tgfjemqj1qd5j@4ax.com>
References: <oprznx7gmf3sxi43@localhost> <umnusvcv4h8ov9esm51jrb2kn602l7df46@4ax.com> <oprzn0stsm3sxi43@localhost>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 67.31.165.27
X-Trace: newsgroups.borland.com 1070564363 67.31.165.27 (4 Dec 2003 10:59:23 -0700)
Lines: 31
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