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. Saving Data to File

Saving Data to File

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
7 Posts 5 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.
  • B Offline
    B Offline
    BeakX
    wrote on last edited by
    #1

    I am currently doing an application and i am required to save data from edit boxes to a file and load them when need. I am familiar with the C++ , FILE *fp method of file i/o. But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) ) Thanks

    D T 2 Replies Last reply
    0
    • B BeakX

      I am currently doing an application and i am required to save data from edit boxes to a file and load them when need. I am familiar with the C++ , FILE *fp method of file i/o. But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) ) Thanks

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

      BeakX wrote:

      But is there a proper and simple MFC method for doing file i/o ?

      See the CFile and CStdioFile classes.


      "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

      G 1 Reply Last reply
      0
      • D David Crow

        BeakX wrote:

        But is there a proper and simple MFC method for doing file i/o ?

        See the CFile and CStdioFile classes.


        "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

        G Offline
        G Offline
        georgeraafat
        wrote on last edited by
        #3

        You can also consider persisting data using CArchive in MFC. George Mileka

        D 1 Reply Last reply
        0
        • G georgeraafat

          You can also consider persisting data using CArchive in MFC. George Mileka

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

          Perhaps BeakX could, too!


          "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

          A 1 Reply Last reply
          0
          • D David Crow

            Perhaps BeakX could, too!


            "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

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

            You can also use fstream.h To get data from the file make an object of ifstream and to write data to file, make an object of ofstream then use these objects just like cout and cin in c++. These are very easy to use. You can visit msdn.microsoft.com for the help on ifstream and ofstream. Good Luck. We Believe in Excellence -- modified at 23:21 Monday 20th February, 2006

            D 1 Reply Last reply
            0
            • B BeakX

              I am currently doing an application and i am required to save data from edit boxes to a file and load them when need. I am familiar with the C++ , FILE *fp method of file i/o. But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) ) Thanks

              T Offline
              T Offline
              ThatsAlok
              wrote on last edited by
              #6

              BeakX wrote:

              But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) )

              I belive CStdioFile is one most stable File handlling class MFC have:)

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta VC Forum Q&A :- I/ IV

              1 Reply Last reply
              0
              • A Aqueel

                You can also use fstream.h To get data from the file make an object of ifstream and to write data to file, make an object of ofstream then use these objects just like cout and cin in c++. These are very easy to use. You can visit msdn.microsoft.com for the help on ifstream and ofstream. Good Luck. We Believe in Excellence -- modified at 23:21 Monday 20th February, 2006

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

                Thanks. I'll be sure and let BeakX know. :rolleyes:


                "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

                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