You can do this but you have to do it in two steps. First, call _open_osfhandle()
to get a C run-time file descriptor from a Win32 HANDLE value, then call _fdopen()
to get a FILE*
object from the file descriptor.
More Related Contents:
- Dynamically load a function from a DLL
- How can I take a screenshot in a windows application?
- How to convert std::string to LPCWSTR in C++ (Unicode)
- Redirecting cout to a console in windows
- Capture screen using DirectX
- How can I run a child process that requires elevation and wait?
- CreateFile: direct write operation to raw disk “Access is denied” – Vista, Win7
- Is it reasonable to use std::basic_string as a contiguous buffer when targeting C++03?
- Sending Two or more chars using SendInput
- How do you use CreateThread for functions which are class members?
- Create an Application without a Window
- Reading from a text field in another application’s window
- How to check if the program is run from a console?
- Using CreateWindowEx to Make a Message-Only Window
- std::unique_ptr, deleters and the Win32 API
- Win32 – read from stdin with timeout
- How to check if window is “Always on top”?
- WinAPI Sleep() function call sleeps for longer than expected
- How do I get the HMODULE for the currently executing code?
- SendInput() not equal to pressing key manually on keyboard in C++?
- How do I print to the debug output window in a Win32 app?
- Replacing WinMain() with main() function in Win32 programs
- How to exit a blocking recv() call? [duplicate]
- Breaking ReadFile() blocking – Named Pipe (Windows API)
- how to get process handle from process id?
- “APIENTRY _tWinMain” and “WINAPI WinMain” difference
- returning std::string/std::list from dll
- Authenticating users using Active Directory in Client-Server Application
- C++ Win32 keyboard events
- Convert a C++ program to a Windows service?