I get the file handle using API GetStdHandle, but how to convert this handle
to an ofstream?
Thanks in advance.
Buboi
There is no way to do so directly, ostreams (why oFstream?) don't have an
API fo that. However, there is help:
- Many vendors include an extension to their IOStream lib that takes handles
or filedescriptors.
- You could wrap the handle in a streambuf and use that with any IOStream.
- You could take a look at Boost's latest IO library, which includes such
functionality.
Uli
Standard handles are already wrapped into streams - cin, cout, cerr.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
http://www.flounder.com/handles.htm
--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------
"Buboi Peng" <bu...@public2.sta.net.cn> wrote in message
news:uoz7qUZx...@TK2MSFTNGP11.phx.gbl...