Solved

How to Serialize a CListBox and members

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

Technology Partners: 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

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

734 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