Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - Overloading DoPropExchange()
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Overloading DoPropExchange()

 Post Reply Post Reply
Author
Message
EricFowler View Drop Down
Groupie
Groupie


Joined: 01 December 2009
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote EricFowler Quote  Post ReplyReply Direct Link To This Post Topic: Overloading DoPropExchange()
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 24 December 2009 at 10:39am

Hi,

Use pGroup->GetItems()->Add(new CYourgroupItem());  instead of AddTextItem.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.