Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to Serialize a CListBox and members

Posted on 1997-08-19
2
Medium Priority
?
276 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 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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses
Course of the Month9 days, 20 hours left to enroll

927 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