I am sure that you can write an implementation of streambuf that is output via OutputDebugString . This is not entirely straightforward, but possible.
Of course, one could use something like this:
std::stringstream ss; ss << something << another << variable << here << endl; OutputDebugString(ss.str().c_str());
You may need to use MultiByteToWideChar to convert c_str () to a wide string if the UNICODE function is enabled in your project.
source share