Solved

How to Serialize a CListBox and members

Posted on 1997-08-19
2
261 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
2 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 50 total points
Comment Utility
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
Comment Utility
First serialize the number of items:
ar << m_lbStrings.GetCount()
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now