Solved

Problems serializing a CString

Posted on 1999-01-06
1
219 Views
Last Modified: 2013-11-20
I am trying to serialize a CArray of a class I made that has a member variable that is a CString.  None of the other member variables are a problem, just CString variables.  When I save a file, and then reload it, the CString variable is garbage.

Can I do this? / What is the trick?  Thanks in advance.
0
Comment
Question by:bluthi
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1327317
The general answer is to use CArchive::ReadString() and CArchive::WriteString() to serialize CStrings.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 95
string initialization in java 11 113
changeXy challenge 13 81
Work with App store 7 51
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

786 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