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. CStdioFile issue! :(

CStdioFile issue! :(

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • A Offline
    A Offline
    Arrin
    wrote on last edited by
    #1

    Hello, i try to open a file with CStdioFile but fails any time when i try! I receive an error 11, and GetErrorMessage returns a "File Error > (11) "A Sharing Violation Occurred ..."" This is when i use VS2008, but the same function and same file with VS2005 works normal, without any errors!

    CStdioFile pStdFileLocal;
    if(!pStdFileLocal.Open(csFilePath, CFile::modeRead, &e))
    {
    // error handling ...
    }

    Is there any change in VS2008 with files and file functions??? Thanks for any help! Arrin

    C A 2 Replies Last reply
    0
    • A Arrin

      Hello, i try to open a file with CStdioFile but fails any time when i try! I receive an error 11, and GetErrorMessage returns a "File Error > (11) "A Sharing Violation Occurred ..."" This is when i use VS2008, but the same function and same file with VS2005 works normal, without any errors!

      CStdioFile pStdFileLocal;
      if(!pStdFileLocal.Open(csFilePath, CFile::modeRead, &e))
      {
      // error handling ...
      }

      Is there any change in VS2008 with files and file functions??? Thanks for any help! Arrin

      C Offline
      C Offline
      Cvaji
      wrote on last edited by
      #2

      did you try modShareDeny??

      modified on Friday, April 9, 2010 11:37 AM

      A 1 Reply Last reply
      0
      • A Arrin

        Hello, i try to open a file with CStdioFile but fails any time when i try! I receive an error 11, and GetErrorMessage returns a "File Error > (11) "A Sharing Violation Occurred ..."" This is when i use VS2008, but the same function and same file with VS2005 works normal, without any errors!

        CStdioFile pStdFileLocal;
        if(!pStdFileLocal.Open(csFilePath, CFile::modeRead, &e))
        {
        // error handling ...
        }

        Is there any change in VS2008 with files and file functions??? Thanks for any help! Arrin

        A Offline
        A Offline
        Ajay Vijayvargiya
        wrote on last edited by
        #3

        All the processes reading the same file, must open in CFile::shareDenyNone mode.

        A 1 Reply Last reply
        0
        • C Cvaji

          did you try modShareDeny??

          modified on Friday, April 9, 2010 11:37 AM

          A Offline
          A Offline
          Arrin
          wrote on last edited by
          #4

          Hi, sorry is my mistake :( i have already open that file before and did n close the file handle :( thanks for answer Arrin

          1 Reply Last reply
          0
          • A Ajay Vijayvargiya

            All the processes reading the same file, must open in CFile::shareDenyNone mode.

            A Offline
            A Offline
            Arrin
            wrote on last edited by
            #5

            Hi, sorry is my mistake :( i have already open that file before and did n close the file handle :( thanks for answer Arrin

            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