Getting stdout on p call to unmanaged dll?

I have an unmanaged DLL that writes log messages to standard output. I call this DLL using P-invokes from a WPF application and I need to get the standard output stream log. I tried Console.SetOut, but it only seems to capture information written using Console.Write, etc.

Does anyone have any ideas? I found similar questions asked elsewhere, but they have no answers.

+4
source share
1 answer

Since you are already calling PInvoke, I think you do not mind the additional call to SetStdHandle . A similar topic here Redirect stdout + stderr to a C # Windows service

+2
source

Source: https://habr.com/ru/post/1300531/


All Articles