Print Page | Close Window

Overloading DoPropExchange()

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel
URL: http://forum.codejock.com/forum_posts.asp?TID=15917
Printed Date: 23 November 2024 at 9:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Overloading DoPropExchange()
Posted By: EricFowler
Subject: Overloading DoPropExchange()
Date Posted: 23 December 2009 at 3:25pm
I wish to store to disk certain properties associated with each group text item in a task panel (it is a text string comprising a database key used to look up associated information, but that should not matter).

Since serialization is handled through DoPropExchange() I assume I must overload some part of that mechanism.

If I declare a class derived from CXTPTaskPanelGroupItem, then overload DoPropExchange() in that class, I am faced with the problem that insertion of my items into my group is done through CXTPTaskPanelGroup::AddTextItem(), which returns an object of type CXTPTaskPanelGroupItem *, which does not support my overload.

My first attempt was to derive a class from CXTPTaskPanelGroup, and have it create and insert my item. But the problem remains: the stored item is not of my class, but the base class, and the serialization/deserialization code I insert into the derived class will not be called.

What am I doing wrong? Remember, the objective is to store a small invisible bit of text along with a task panel group item, and to read/write it out of/into the same archive as is routinely done with DoPropExchange(). This must be easy.

Thanks

Eric



Replies:
Posted By: Oleg
Date Posted: 24 December 2009 at 10:39am

Hi,

Use pGroup->GetItems()->Add(new CYourgroupItem());  instead of AddTextItem.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net