Click here to Skip to main content
12,699,492 members (34,813 online)
Rate this:
Please Sign up or sign in to vote.
See more: MFC VisualC++
Need help..Can I save this List control and retrive it later ? so that i don't have to enter all values again in editable column and in combobox column.

Thanks in advance.
Posted 19-Nov-12 6:29am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

There are a lot of examples of how to do this on the web. Basically, you need two functions: one that serializes the current contents of the control to an XML file, and one that loads the control by deserializing the file. You can do this either with separate methods that take the control as a parameter or by subclassing the control.

It is a common technique, so there are lots of examples on the web, better than I could offer in a quick answer. It's pretty straightforward, but does require a bit of knowledge about XML and how to read and write XML files.
peoria123 19-Nov-12 15:48pm
Thank you for your reply. I don't know how to read and write file in xml. I am working in vc++ mfc dialogbased application. is serialization is good method for dialogbased application? any alternative method (like get ,set current value)??
(dialog box has 2 tabs ..List control with editable columns and combobox columns on each tab)

Thank you.
Gregory.Gadow 19-Nov-12 15:58pm
XML (eXtensible Mark-up Language) is just a text file that follows specific rules. It is very flexible; there were a few versions of Excel that used XML to store spreadsheets. A full tutorial would be well beyond what can be given as a quick answer, I'm afraid: you will have to do some research to find a solution that works best for you. As for "serialize" and "deserialize", those are just fancy words that mean "convert to and from a text format that can be moved between different types of data structures" including files.
peoria123 20-Nov-12 12:25pm
Hi Gregory,
Thank you for your reply.
I searched on google about XML file but I don't know which example is appropriate for me.can you please send me a link which will help me or guide me. Is there any other option to save the listcontrol?
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100