15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Serialization with versioning (VERSIONABLE_SCHEMA)

Richard Newman -- RNewman@spur.com
Friday, December 06, 1996

Environment:  VC++ 4.2-flat, Win 95, NT 4.0

Hello,

How do we use nested serialization and versioning at the same time?  If =
a base class calls GetObjectSchema, the derived class can't seem to do =
the same successfully after it's called the base class' Serialize (just =
before the derived does the GetObjectSchema call).  Can anyone help with =
this?

class A : public CObject;
class B : public A;

BOOL A::Serialize(CArchive& ar)
{
	CObject.Serialize(ar);
	...
	GetObjectSchema();    //Returns version
	...
}

BOOL B::Serialize(CArchive& ar)
{
	A::Serialize(ar);
	..
	GetObjectSchema();    // Returns -1
	...
}




CraigTT@ccmail01.PE-Nelson.COM
Monday, December 09, 1996

[Mini-digest: 3 responses]

     If you're going to do nested serialization, either because you have a 
     class hierarchy or you have an actual instance of one class as a 
     member of another class, you have to handle versioning yourself.  
     MFC's versioning ONLY works one level deep when using the insertion 
     and extraction operators through POINTERS to objects.  MFC does 
     nothing for you when you call Serialize directly since you're going 
     directly to your code.
     
     Tim Craig
     PE-Nelson


______________________________ Reply Separator _________________________________
Subject: Serialization with versioning (VERSIONABLE_SCHEMA)
Author:  mfc-l@netcom.com at SMTPLINK-PEN
Date:    12/9/96 6:05 PM


Received: by ccmail from lax.PE-Nelson.COM 
>From owner-mfc-l@majordomo.netcom.com
X-Envelope-From: owner-mfc-l@majordomo.netcom.com
Received: from majordomo.netcom.com (listless.netcom.com) by lax.PE-Nelson.COM 
(5.65c/IDA/PE-Nelson)
    id AA03637; Mon, 9 Dec 1996 18:03:30 -0800
Received: by majordomo.netcom.com (8.7.5/8.7.3/(NETCOM MLS v1.01)) id OAA03439; 
Mon, 9 Dec 1996 14:21:36 -0800 (PST)
Message-Id: <01BBE389.EE4EFFC0@ENG04.spur.com> 
From: Richard Newman 
To: "'mfc-l@netcom.com'" 
Subject: Serialization with versioning (VERSIONABLE_SCHEMA) 
Date: Fri, 6 Dec 1996 15:27:01 -0700
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii" 




| Вернуться в корень Архива |