Board index » cppbuilder » Load/Save component property

Load/Save component property

Hy,

I would like to create a new component : TcompatibilityList
With a CompatibilityList property (CompatibilityList is a int table "
CompatibilityList[16][16]")

class PACKAGE TCompatibilityList : public TComponent
{
private:
        int** FCompatibility;
protected:
    void __fastcall SetCompatibilityList(int** ECompatibilityList);
public:
  __property int** CompatibilityList ={read=FCompatibility,
write=SetCompatibilityList};
__published:

Quote
};

To setup the table, I click on "CompatibilityList" property and a table is
displayed. Actualy that work.

But when I quit my project, the table value are not saved.

How can I save this table when I close a project and restore it when I load
the project?

Thanks

 

Re:Load/Save component property


Only TPersistent-derived classes and base data types can be saved
automatically for you.  But your property is neither, it's not a class and
it's more complex then a basic data type.  So you would need to override
your component's DefineProperties() method and call the TFiler's
DefineBinaryProperty() method to provide custom reading and writing handlers
for managing the data yourself.

Gambit

Quote
"Emmanuel RIVIERE" <emmanuel.rivi...@NetTest.com> wrote in message

news:3c064163_1@dnews...

Quote
> I would like to create a new component : TcompatibilityList
> With a CompatibilityList property (CompatibilityList is a int table "
> CompatibilityList[16][16]")
<snip>
> But when I quit my project, the table value are not saved.

Other Threads