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. How to retrieve bits from a file using MFC

How to retrieve bits from a file using MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
3 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.
  • P Offline
    P Offline
    Pankaj D Dubey
    wrote on last edited by
    #1

    I am writing a code to read the bits from the file. Starting from first bit, i can read the whole file, and can retrieve the whole data as well. But if i want to retrieve the bits from somewhere between the file, how should i do this? One more thing, i am doing a string comparision of a module(and that module repeats several times in the file) and then i am retrieving the bits hence i can,t apply character counting.

    It was a woman who drove me to drink but I never got opportunity to thank her

    C K 2 Replies Last reply
    0
    • P Pankaj D Dubey

      I am writing a code to read the bits from the file. Starting from first bit, i can read the whole file, and can retrieve the whole data as well. But if i want to retrieve the bits from somewhere between the file, how should i do this? One more thing, i am doing a string comparision of a module(and that module repeats several times in the file) and then i am retrieving the bits hence i can,t apply character counting.

      It was a woman who drove me to drink but I never got opportunity to thank her

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      dubeypankaj wrote:

      But if i want to retrieve the bits from somewhere between the file, how should i do this?

      It depends on how you are reading your file. Are you using an ifstream, a FILE, a CFile, ... ? Typically, you can set the file pointer (e.g. CFile::Seek, ifstream::seekg, ...). You should look at the documentation for more information.

      Cédric Moonen Software developer
      Charting control [v1.5] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • P Pankaj D Dubey

        I am writing a code to read the bits from the file. Starting from first bit, i can read the whole file, and can retrieve the whole data as well. But if i want to retrieve the bits from somewhere between the file, how should i do this? One more thing, i am doing a string comparision of a module(and that module repeats several times in the file) and then i am retrieving the bits hence i can,t apply character counting.

        It was a woman who drove me to drink but I never got opportunity to thank her

        K Offline
        K Offline
        KarstenK
        wrote on last edited by
        #3

        Read the file in binary mode completly in a buffer, and than you can do what you want. :-\

        Press F1 for help or google it. Greetings from Germany

        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