[omniORB] printing out orb traces in MFC programs

Stefan Seefeld seefeld@sympatico.ca
Wed, 02 May 2001 14:02:30 -0400


jnye@micro-optics.com wrote:

> If anyone has any example code, it would be greatly appreciated.


Just redirect cout/cerr to some other stream:

std::streambuf *outbuf = ...;
std::cerr.rdbuf(outbuf);
std::cout.rdbuf(outbuf);

Where you get the outbuf from is a different matter. You may use a 
filebuf, or
write your own simple streambuf using 'OutputDebugString' or something 
similar.
Ah the joy of Windows programming...

Regards,    Stefan