๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: cout, printf

#12457
From: dESFasado
Date: Thu, 04 Dec 2003 16:44
27 lines
1996 bytes
En Thu, 04 Dec 2003 08:33:04 -0800, Bob Gonder <notbg@notmindspring.invalid> escribi๏ฟฝ:

> dESFasado wrote:
>
>> I know maybe this is a so trivial question. I've recently moved from delphi to builder c++ and found out that's not that simple to use the console;
>>
>> I've search on google many code snippets that'll do the work using printf, cout and friends but none worked at all.
>>
>> So my question is simple. Which is the most easiest way to have a console ouput in a gui application using borlnad c++ builder 6 under windows xp?
>
> Three ways to go about it:
>
> 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.

>
> 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)
Technical Details
Message-ID: <oprzn0stsm3sxi43@localhost>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <oprznx7gmf3sxi43@localhost> <umnusvcv4h8ov9esm51jrb2kn602l7df46@4ax.com>

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 09:04:14 PST
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: cout, printf
References: <oprznx7gmf3sxi43@localhost> <umnusvcv4h8ov9esm51jrb2kn602l7df46@4ax.com>
Message-ID: <oprzn0stsm3sxi43@localhost>
From: dESFasado <nospame@anymore>
Content-Type: text/plain; format=flowed; charset=iso-8859-15
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Date: Thu, 04 Dec 2003 13:44:43 -0300
User-Agent: Opera7.21/Win32 M2 build 3218
NNTP-Posting-Host: 200.55.60.29
X-Trace: newsgroups.borland.com 1070556291 200.55.60.29 (4 Dec 2003 08:44:51 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail