Win32 stdout redirection

Place to talk about all that new hardware and decaying software you have.

Moderator: General Mods

Post Reply
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Win32 stdout redirection

Post by Nach »

Is it possible to redirect stdout within a Win32 GUI app to a file that it'll actually write something? and I mean without ommiting -mwindows on linking, or using > on calling the app.

I tried freopen() and dup2() on stdout to a file, but that seems to only work when the app is launched with a pipe command. Otherwise it seems the output is being witheld.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Nevermind, I figured it out.

Seems when compiling with -mwindows, stdout and friends no longer point at the appropriate file descriptor. Working with them via descriptor directly solves issues.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Post Reply