0

I can use CFile to get member m_hFile,how to get the CFile's file descriptor(like File*)?I need to convert file handle to file pointer. Thanks!

zet
  • 169
  • 10

1 Answers1

2

To my knowledge CFile doesn't use the FILE * abstraction (it uses the windows ReadFile/WriteFile APIs), however you can use _fdopen to get a FILE * from a file descriptor and _open_osfhandl to get a file descriptor for a HANDLE.

You can also use CStdioFile to use FILE * based file operations.

SoronelHaetir
  • 14,104
  • 1
  • 12
  • 23