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