[Wine] printf in GUI App?

Dee Ayy dee.ayy at gmail.com
Wed May 9 21:40:14 CDT 2007

In a MSVC++ 6.0 Win32 Application (not a Win32 Console Application), I
use printf.  When I launch the app from a Windows console, the app
does not block (i.e. the command shell is ready for another command
although my app has not terminated).  No printf statements are
displayed on the console/command shell.

The same app when launched/run in Wine 0.9.33 on Mac OSX in an X11
shell does block (i.e. the shell will not accept new commands until my
app has terminated).  printf happily outputs to the shell as if this
was a console app.  I LIKE THIS BEHAVIOR and do not know if it is a
bug in Wine.  Technically I would say it is a bug since it is not the
behavior on a Windows machine.

Is there a way to achieve this behavior in Windows?  Perhaps with a
simple compile flag?  I googled and found this
http://www.halcyon.com/~ast/dload/guicon.htm which looks great in the
first paragraph, but requires modified code as I read on.

Why the different behaviors from unmodified code?
Or is this the answer, "The problem is that the older I/O streams were
designed to use UNIX-style "file descriptors," where integers are used
instead of handles (0 for stdin, 1 for stdout, and so on). That's
convenient for UNIX implementations, but Win32 C compilers have to
provide yet another I/O layer to represent that style of I/O, since
Win32 does not provide a compatible set of functions."?

Aside: I've often wondered why some shells seem to show all history
while some seem limited.  The MAX_CONSOLE_LINES at the above link may
be related to that issue.



More information about the wine-users mailing list