Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

About Serialization

Posted on 1999-06-25
5
Medium Priority
?
208 Views
Last Modified: 2013-11-20
Hi all,

I am currently giving the finishing touches of large application (MDI,
Doc/View) and one of the last features still to implement is the command
'Save'.
I have derived all my classes from CObject so I thought that I could use
serialization mechanism. The problem with this is that I need to document
the format of my files so other people could write converters for these
files. Is this possible with the standar serialization mechanism?
It would be absolutely great if anybody could give me some examples about
how to do this.

Thanks in advance,
Carlos
0
Comment
Question by:qocarlos
[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
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:bholz
ID: 1307912
There is imho no way to document this thing. You have to gibe away the header files of the CDocument-Class (and all other serialized classes) you serialize to disk so that any other can serialze in your CDocument and convert it.

Regards,

Bernd

0
 
LVL 3

Author Comment

by:qocarlos
ID: 1307913
Bernd,
thank you for your answer, but I need more information about this.
Do you recomend me to leave serialization?
0
 
LVL 2

Accepted Solution

by:
bholz earned 300 total points
ID: 1307914
Carlos,

it depends how you want others to be able to develop convertes. If you use serialization you force the to use MFC, else the converter can be any language.
If you should use Seialization depends on your needs. If it is only one CDocument with some simple objects in it you should define an common format.

Another problem with serialization is versioning. If you want a new version of your software to be able to read the old format you have to use the old AND the new class definition. This might me a big drawback.

Regards,

Bernd

0
 
LVL 3

Author Comment

by:qocarlos
ID: 1307915
Thanks and sorry for the delay.
I have decided to define my own file format. Everything now
is working fine except that I don't know how to save the ole objects inserted in the application (it is a containter application).
I have asked this question also in experts-exchange.
Any idea
0
 
LVL 2

Expert Comment

by:bholz
ID: 1307916
I never programmed an OLE container by now but I guess there is no other way than using you own format but serializing the OLE Object.. I don't know how other OLE containers save their documents...

Bye,

Bernd

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

662 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