What is serialization ?which function is responsible for
serializing data ?

Answers were Sorted based on User's Feedback



What is serialization ?which function is responsible for serializing data ? ..

Answer / satheeshkedarisetti

Serialization is used for object persitence. using this you
can store your object current state in disk. The same state
you can get after restarting your application.

A serializable class usually has a Serialize member
function, and it usually uses the DECLARE_SERIAL and
IMPLEMENT_SERIAL macros, as described under class CObject.

The overloaded extraction (>>) and insertion (<<) operators
are convenient archive programming interfaces that support
both primitive types and CObject-derived classes.

Is This Answer Correct ?    9 Yes 2 No

What is serialization ?which function is responsible for serializing data ? ..

Answer / rck

serialization means writing data to the file and reading
data from the file.
This is supported by CArchive class and the function is
serialize()

serialize function is like
if(ar.IsStoring())
{
//code for storing data
}
else(ar.IsLoading())
{
//Code for loading data
}

Is This Answer Correct ?    2 Yes 0 No

What is serialization ?which function is responsible for serializing data ? ..

Answer / ctharam

Serialization means conversion of Objects from bytes into streaming...and store those data in a External storage like Hard Disk.

Serialize is called by CArchive::ReadObject and CArchive::WriteObject.


Use CArchive::IsLoading or CArchive::IsStoring to determine whether the archive is loading or storing.

IsStoring():-
-------------

// example for CObject::Serialize
void CAge::Serialize( CArchive& ar )
{
CObject::Serialize( ar );
if( ar.IsStoring() )
ar << m_years;
else
ar >> m_years;
}


IsLoading() :-
---------------

int i;
extern CArchive ar;
if( ar.IsLoading() )
ar >> i;
else
ar << i;

Is This Answer Correct ?    0 Yes 0 No

What is serialization ?which function is responsible for serializing data ? ..

Answer / manish(yugma)

Serialization is a process used to read and write object
from and to secondary storage device respectively.Base
class is CArchive class of MFC. it is used basically in
doc-view architecture programming.DECLARE_SERIAL and
IMPLEMENT_SERIAL macro is used in header and .cpp file
respectively, which has to be serialize.

Is This Answer Correct ?    4 Yes 5 No

What is serialization ?which function is responsible for serializing data ? ..

Answer / abhijit

Adding to the above mentioned points i would like to add
the following:

Serialize() function has to be overridden to take advantage
of serialisation support

DECLARE_SERIAL macro provides prototypes for serialisation
functions

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More MFC Interview Questions

i have created runtime menu -- ( admistrator ->managepackage,manage module). but now i want to open a dialog when i select manage package and any other diaolg when selecting manage module ( whole selection is at run time only ) . Please HELP .its urgently required

3 Answers   Patni,


what is the difference between compiling and building?

1 Answers  


What?s the difference between Modal and Modeless Dialog?

12 Answers   Jekson, Usl India,


Whats is DDX & DDV in MFC?

1 Answers   HCL,


What is the difference between the ASSERT and VERIFY macros?

4 Answers  






Name the Synchronization objects?

2 Answers  


How can i implement the dynamic menus in MFC plz give the code

2 Answers  


how do u identify RTTI in vc++

4 Answers   Siemens,


If there is more than 100 control in a window how we can change the Taborder of a controls

4 Answers   Satyam,


What is the use of message map ?

5 Answers   TCS,


is it possible to display a window .without using windowclass

1 Answers   E Logic,


Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A. Explain how a pointer to function can be declared in C++? B. List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header ("Include") Files.

3 Answers   ABC, HCL, Infosys,


Categories