
29 Jun
2009
29 Jun
'09
1:45 p.m.
Hi! I'm outputting the progress from an externally executed command line application using the windows API call OutputDebugString. This means that I need to convert all line breaking characters to flush commands to make sure the text is outputted when a new line is received rather than when some underlying structure finds it suitable to linebreak. I've created a sink that writes to OutputDebugString and it works great, however unless I manually insert lots of std::endl (or flushing some other way) I won't get any output until the buffer is full. Is it possible to write an iostream filter that forces a flush on newlines or is this something I need to handle before feeding data into my stream? /David