flat assembler
Message board for the users of flat assembler.

Index > Windows > Problem with console program output redirection

Author
Thread Post new topic Reply to topic
Hobo



Joined: 05 Jul 2007
Posts: 11
Hobo
Hello.

I was writing a program earlier which i had intended for it's output to be redirected, however when i got to the stage of trying to redirect it's output, i found an error... The program will run fine, no errors of any kind but when output is to be redirected, the file it is suposed to be dumped to will contain nothing. When running normally inside a console, with output to appear on the console screen it works fine. What could prevent it from having it's output from being redirected?

I wrote a small program demonstrating this behavior, it is attatched to the message. Included in the zip folder is the source code of the program, the compiled program and a batch file which tries to redirect the output to a file and then use the batch TYPE command to write the file to the screen.

Thanks in advance if anyone can help with this.


Description:
Download
Filename: Test.zip
Filesize: 1.33 KB
Downloaded: 21 Time(s)

Post 15 Jan 2008, 04:26
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 693
Location: Adelaide
sinsi
From the SDK on WriteConsole
Quote:

However, WriteConsole fails if it is used with a standard handle that is redirected to a file.

I think you need to use WriteFile for redirection.
Post 15 Jan 2008, 04:54
View user's profile Send private message Reply with quote
Hobo



Joined: 05 Jul 2007
Posts: 11
Hobo
Thank you Smile
Post 15 Jan 2008, 05:01
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.