Solved

How to Serialize a CListBox and members

Posted on 1997-08-19
2
265 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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Complete beginner needs help making a cron job 9 129
maxBlock challenge 30 145
abstract class with all non abstract mentods 6 84
Thin secure Windows 10 5 107
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.

756 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