?
Solved

Serializing

Posted on 1998-09-04
1
Medium Priority
?
272 Views
Last Modified: 2013-11-20
The prime requirement for an object to be serialized is that it should
be derived from CObject class. But 'CString' class is not derived
from CObject. How it's still possible the CString objects ?
Adv. thanks!
0
Comment
Question by:rsraj
1 Comment
 
LVL 1

Accepted Solution

by:
motigust earned 40 total points
ID: 1321741
This is requiered only if you want to implement a "Shellow" serialization, which means writing the data of the object "as is" to the disk. the CObject implements such functionality if you uses the "DECLARE_SERIAL" and "IMPLEMENT_SERIAL" macros.

This functionality may be not usefull if your data holds pointers, because there is no meaning to write the pointer into a file.

Beside that, an object may implement/override a function named "Serialize" that gets CArchive object as a parameter, and serialize its data into it. - It has nothing with the CObject.

This is the way the "CString" object is implemented.

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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…
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.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

864 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