   redirecting output question
  hello,i am working on a tool to compile .map files into a custom format ( yes once again)now i want to add a log window to the application which is written with pure win 32 api now i wonder, how can i redirekt the output of printf(...) to be send directly to the windowi don t want to use a console application, just send this output to a custom windowany help would be appreciated, since i can hardly find any useful information about this topicthx in advance 
  Probably the easiest solution is to just rip out those printf() calls and replace them with calls to your own logging function that outputs to the window.Alternately, if you don''t have access to the code that''s calling printf() you can replace the stdout handle with a pipe, then run an overlapped I/O function to grab data from the other end of the pipe and dump it to your window. ;  If you want to redirect it to a file, it's a one-liner:freopen(stdout, "myfile.txt", "w");Otherwise, you're probably better off creating a global buffer or something and replace all of the printfs with sprintfs to that buffer.   [edited by - aprosenf on February 10, 2004 9:17:52 PM];  Probably the "correct" way is to use a pipe. Of course, doing that in "pure Win32 API" is a real pain in the ass. It''s probably a few hundred lines of code when it should be like two (like it is in linux). So, I would use something like wxWindows or ACE or something that has portable text piping. ;  and is there an easy way to do piping with mfc?i could make my program with mfc then that wouldn t matter 