freopen equivalent

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

I am writing a C# application that uses an unmanaged C++ dll. The
unmanaged C++ dll is wrapped in a managed C++ assembly.

I would like to capture what is being written to stdout and stderr by
the unmanaged dll. I am not spawning a new process for this dll, it
runs in the C# application process.

I've tried PInvoking freopen but I get an exception about a NULL
reference.

I've tried running freopen in the managed C++ code, but I get the same
NULL reference exception.

Anyone have any ideas?

Thanks,
- Andrew
 
read the documentation!
and try to gather more information from the error function:
_doserrno, errno, _sys_errlist, and _sys_nerr
 
Back
Top