Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to Serialize a CListBox and members

Posted on 1997-08-19
2
Medium Priority
?
272 Views
Last Modified: 2013-11-19
I have a CFormview application that displays 4 list boxes on screen at the same time.  Each list box can have up to 12 CString data members.  How then do I serialize each of these members located inside the list box.  I have tried using the << and >> operators to serialize it as a whole but with no success.  I have a member variable declared for each list box which is known to both the doc and view.

Please help a newbie.

Thanks
0
Comment
Question by:magarnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 200 total points
ID: 1304190
You must write the serialization code yourself, based on the serializability of CStrings.

Iterate through all the string members of each listbox (a loop is fine), retrieve the CString value associated with each item and insert it into the archive with the << operator.
Loading is exactly the contrary: first read the string from the archive, then insert it into the listboxes.

Davide Marcato.
0
 

Expert Comment

by:syjwg
ID: 1304191
First serialize the number of items:
ar << m_lbStrings.GetCount()
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question