Hook the printf outputs

I want to get the printf outputs of a foreign C++ dll in my C# application. Is there a way to install a hook?

The foreign c++ dll is encapsulated via my own C++ dll (interface C++ -> C#). I tried to overwrite printf there - unfortunately without success.

Thank you for any hints.
1. You execute code via a small console executable of your own which include the DLL
2. You launch that console executable hidden from your main application and capture the output via interprocess communication.
Registered users can post here. Sign in or register to post.