In the excellent sample for writing console-applications that comes with
Visual C++ 4.0, the main() function first frees the console with
FreeConsole(), then allocates a new one with AllocConsole(). A comment
then says something to the effect that standard C I/O with printf etc.
will not work unless one "fixes" the handles. I have searched the
documentation for hours, but couldn't figure out how to do it. Any
suggestions?
What I want is this:
When my Win32 console application starts, I want to create a new
console, then re-size it, then write to it with standard-C printf and
read from it with scanf. I am working with automated translation from
pascal-programs written on a Sparc platform to Win32 programs compiled
with GNU CC (http://www.cygnus.com).
How does one "reconnect" the stdout, stdin, and stderr handles with the
new handles for the new console?
Thanks in advance
Ulrik Petersen
ulr...@daimi.aau.dk
http://www.codeguru.com/misc/console.shtml
One of the key calls it makes is to ::_open_osfhandle(). This allows you to
associate a C runtime file handle with a windows file handle.
Hope this helps others out there too...
Max
In article <35F65D...@daimi.aau.dk>,
--
Max Leung, mle...@my-dejanews.com
------------------------------------------------
"My clever .sig q
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum