Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CFile to read binary file

CFile to read binary file

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gurucplusplus
    wrote on last edited by
    #1

    Does CFile::Read take a binary file?

    N M 2 Replies Last reply
    0
    • G gurucplusplus

      Does CFile::Read take a binary file?

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      Yes.

      nave [OpenedFileFinder]

      1 Reply Last reply
      0
      • G gurucplusplus

        Does CFile::Read take a binary file?

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        Yes. CFile is designed toward binary file access. It's basically a wrapper for the Windows CreateFile()/ReadFile()/WriteFile()/SetFilePointer()/ CloseHandle()/etc. APIs. Mark

        "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

        G 1 Reply Last reply
        0
        • M Mark Salsbery

          Yes. CFile is designed toward binary file access. It's basically a wrapper for the Windows CreateFile()/ReadFile()/WriteFile()/SetFilePointer()/ CloseHandle()/etc. APIs. Mark

          "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

          G Offline
          G Offline
          gurucplusplus
          wrote on last edited by
          #4

          CFile::Read("test.bin",CFile::modeRead) is the mode to read a binary file? or different flag? Thanks

          M 1 Reply Last reply
          0
          • G gurucplusplus

            CFile::Read("test.bin",CFile::modeRead) is the mode to read a binary file? or different flag? Thanks

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            From the docs: "One access permission and one share option are required"... something like CFile file(_T("pathname"), CFile::modeRead | CFile::shareDenyNone); Mark

            "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups