freopen equivalent

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
 
L

Lloyd Dupont

read the documentation!
and try to gather more information from the error function:
_doserrno, errno, _sys_errlist, and _sys_nerr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top