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. Retain MFC Controls values for Next Open VC++6.0

Retain MFC Controls values for Next Open VC++6.0

Scheduled Pinned Locked Moved C / C++ / MFC
c++questiondatabasecomhelp
4 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.
  • S Offline
    S Offline
    Sumit Kapoor
    wrote on last edited by
    #1

    Hi… How r u? What’s going on? Hope every thing is well. I need any idea in VC++. Background: There is a form or dialog which is picking too many values from database & taking time to manipulate those values. Problem: Now I want to retain or save all values in all controls on dialog when second time user open that dialog instead of reload from database. Question: Is there any class can be used to retain all values of all controls on dialog & can be retain on next opening of dialog. If you have any idea, please let me know. I’m waiting… OK! Have a nice day. With Best Regards Sumit Kapoor Never consider anything impossible before trying to solve that..---Sumit Kapoor--- sumit_kapoor1980@hotmail.com

    M 1 Reply Last reply
    0
    • S Sumit Kapoor

      Hi… How r u? What’s going on? Hope every thing is well. I need any idea in VC++. Background: There is a form or dialog which is picking too many values from database & taking time to manipulate those values. Problem: Now I want to retain or save all values in all controls on dialog when second time user open that dialog instead of reload from database. Question: Is there any class can be used to retain all values of all controls on dialog & can be retain on next opening of dialog. If you have any idea, please let me know. I’m waiting… OK! Have a nice day. With Best Regards Sumit Kapoor Never consider anything impossible before trying to solve that..---Sumit Kapoor--- sumit_kapoor1980@hotmail.com

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      There's no automatic way that I know of, you need to do this manually. I did something similar, I keep the variable in static member variable for each class that I create; so that the values are kept; but that only works within one "run" of the program, if you need them to work between "runs" you will need to save them on disk, either in a registry or in a file.


      Maximilien Lincourt Your Head A Splode - Strong Bad

      B S 2 Replies Last reply
      0
      • M Maximilien

        There's no automatic way that I know of, you need to do this manually. I did something similar, I keep the variable in static member variable for each class that I create; so that the values are kept; but that only works within one "run" of the program, if you need them to work between "runs" you will need to save them on disk, either in a registry or in a file.


        Maximilien Lincourt Your Head A Splode - Strong Bad

        B Offline
        B Offline
        BlackDice
        wrote on last edited by
        #3

        You will probably need to make a simple text file. This can be done by using serialization. I haven't done any serialization stuff in a while, so I'm kinda rusty. But I did it in a CFormView-derived class. In the CDocument's save, I also used the CArchive member to serialize my objects that I wanted returned to their previous state. I think if you do this you will also have to change IMPLEMENT_DYNAMIC and DECLARE_DYNAMIC to IMPLEMENT_SERIAL and DECLARE_SERIAL. Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store My articles[^] bdiamond :zzz:

        1 Reply Last reply
        0
        • M Maximilien

          There's no automatic way that I know of, you need to do this manually. I did something similar, I keep the variable in static member variable for each class that I create; so that the values are kept; but that only works within one "run" of the program, if you need them to work between "runs" you will need to save them on disk, either in a registry or in a file.


          Maximilien Lincourt Your Head A Splode - Strong Bad

          S Offline
          S Offline
          Sumit Kapoor
          wrote on last edited by
          #4

          Hi, Thanks for suggesting me solution, I used following article for saving data, http://www.codeproject.com/dialog/dlgset.asp This article use trick & save all control's data in registry.Nice one. Thanks again Have a Nice Life. Sumit Kapoor Never consider anything impossible before trying to solve that..---Sumit Kapoor--- sumit_kapoor1980@hotmail.com

          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