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. Positioning in file

Positioning in file

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 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.
  • M Offline
    M Offline
    Monin D
    wrote on last edited by
    #1

    Before now I used: h=open(....- command and seek/tell for positioning inside file Now I use: hFile=CreateFile(..... command. How to position inside file? Will seek/tell work ?

    Z M M 3 Replies Last reply
    0
    • M Monin D

      Before now I used: h=open(....- command and seek/tell for positioning inside file Now I use: hFile=CreateFile(..... command. How to position inside file? Will seek/tell work ?

      Z Offline
      Z Offline
      Zac Howland
      wrote on last edited by
      #2

      Monin D. wrote:

      How to position inside file? Will seek/tell work ?

      No. fopen returns a FILE pointer. CreateFile returns a file HANDLE. Passing a HANDLE to any of the FILE operations will fail. You can find a list of all the methods you can use with the file HANDLE you get from CreateFile here.

      If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

      1 Reply Last reply
      0
      • M Monin D

        Before now I used: h=open(....- command and seek/tell for positioning inside file Now I use: hFile=CreateFile(..... command. How to position inside file? Will seek/tell work ?

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Call SetFilePointer()

        M 1 Reply Last reply
        0
        • M Michael Dunn

          Call SetFilePointer()

          M Offline
          M Offline
          Monin D
          wrote on last edited by
          #4

          Thank you very much, it helps me.

          1 Reply Last reply
          0
          • M Monin D

            Before now I used: h=open(....- command and seek/tell for positioning inside file Now I use: hFile=CreateFile(..... command. How to position inside file? Will seek/tell work ?

            M Offline
            M Offline
            mostafa_pasha
            wrote on last edited by
            #5

            after use CreateFile that return hFile you can declare CFile m_fFile(hFile) & then use m_fFile.Seek.... if you wanna work with in text mode you should use CStdioFile instead of CFile.

            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