Subj : Re: redirect stdout To : borland.public.cpp.borlandcpp From : maeder@glue.ch (Thomas Maeder [TeamB]) Date : Fri Mar 26 2004 07:36 am "mike" writes: > i was wondering how to go about "redirecting" stdout to an edit control. i'm > writng a GUI and i want to be able to have a button where the user would > click "Compile" and it would compile the specified file and redirect the > output to a edit control. i wanted to do this in real time, so writing it to > a file then reading the file and displaying that in the edit control isn't > an option. any suggestions? I think that this is feasible, but only with considerable effort, and in an implementation specific way. FILE is an abstraction allowing to be used for a variety of backends (console, file, port, ...); I'd be surprised of a backend such as what you have in mind would not be possible. But I'd consider using C++ streams instead. Here, doing what you want could be mostly done in a defined, well documented way: Simply write a streambuf class that writes its characters into the edit control instead of, say, to a file. .