
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Jonathan Turkanis Sent: Monday, February 28, 2005 6:11 PM To: boost@lists.boost.org Subject: [boost] Re: Re: Iostreams Question: Best way tooutputtowin32debugger\outwindow ?
Okay Brian,
The following apparently works, but when OutputDebugString is called I don't see any output. I'm not sure if the previous version worked or not; I've run out of time for now.
Jonathan
struct debug_out_sink : boost::iostreams::sink { debug_out_sink () { using namespace boost::iostreams; chain_.push(newline_filter(newline::windows)); chain_.push(debug_out_sink_impl()); }
void write(const char* s, std::streamsize n) { chain_.write(s, n); }
boost::iostreams::detail::chain<boost::iostreams::output> chain_; };
I didn't see most of this thread, and may be totally off-base here, but you need to use a tool that can intercept the output from OutputDebugString(), as that function assumes there's a debugger attached to its process; if there's no attached debugger, it attempts to use the Windows system debugger, which must be both installed and active. However, I like SysInternals' DebugView, both because it's well-written and easy to use, and because it's free. Very lightweight alternative to invoking a full debugger when that would be overkill. It can do kernel-mode debugging, too, which is a major plus, if you need that; got a copy running on my other machine right now. www.sysinternals.com. And if this is not to the point, or you already know all this, bear in mind that I only had this post available, and skimmed it pretty cursorily, and please just disregard my post. Reid