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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CFile::Read for readonly files

CFile::Read for readonly files

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
4 Posts 4 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.
  • R Offline
    R Offline
    Rakesh5
    wrote on last edited by
    #1

    Hi all, I am trying to read a file having read-only property checked. i am not able to read the file and it is showing some exception from the file wincore.cpp stating "Accessing filepath\filename was denied".. Is it a problem with CFile::moderead?? thanks, rakesh.

    D R K 3 Replies Last reply
    0
    • R Rakesh5

      Hi all, I am trying to read a file having read-only property checked. i am not able to read the file and it is showing some exception from the file wincore.cpp stating "Accessing filepath\filename was denied".. Is it a problem with CFile::moderead?? thanks, rakesh.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Can you at least show the relevant code?

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      1 Reply Last reply
      0
      • R Rakesh5

        Hi all, I am trying to read a file having read-only property checked. i am not able to read the file and it is showing some exception from the file wincore.cpp stating "Accessing filepath\filename was denied".. Is it a problem with CFile::moderead?? thanks, rakesh.

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        Most decidedly, this has nothing to do with CFile itself, but that you're doing something wrong. Can you show us your code?

        “Follow your bliss.” – Joseph Campbell

        1 Reply Last reply
        0
        • R Rakesh5

          Hi all, I am trying to read a file having read-only property checked. i am not able to read the file and it is showing some exception from the file wincore.cpp stating "Accessing filepath\filename was denied".. Is it a problem with CFile::moderead?? thanks, rakesh.

          K Offline
          K Offline
          krmed
          wrote on last edited by
          #4

          Without seeing your code, most likely you're trying to open the file with read/write access, which will fail. If you show your code, perhaps we can be more helpful.

          Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

          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