I posted this to the interop group. I'm reposting to troll for a few
more ideas.
In my managed C# app we capture trace statements and direct them to a
log file using trace listeners. Part of the app uses unmanaged C++
dlls, and unfortunately, the C++ printfs don't get picked up and are
simply printed to the console window.
Is there any way I can capture the output of the printfs and then
redirect them to the same file that the trace listener is writing to?
I do have access to the unmanaged C++ code if the solution involves
not using printfs. The important thing is that the C++ printfs and the
C# trace messages end up in the same file.
One solution from the interop group was to compile the C++ with /clr
and then replace the printfs with Trace.WriteLine(). Any less invasive
techniques. Maybe somehow redirecting the printfs to someplace that
can be picked up by .Net.
Thanks
Mitch