I'm experimenting with saving and loading components using Delphi's streaming mechanism. I've declared a new class with the following declaration :
TOmxSourceID = type integer;
TOmxClassID = type integer;
TOmxSourceClass = class(TPersistent)
property Source : TOmxSourceID read FSource write FSource;
property SourceClass : TOmxClassID read FClass write FClass;
I have then declared a new panel component with TomxSourceClass as a published property
TOmxDataEntryPanel = class(TPanel)
constructor Create(AOwner : TComponent); override;
property SourceClass : TOmxSourceClass read FSourceClass;
constructor TOmxDataEntryPanel.Create(AOwner: TComponent);
FSourceClass := TOmxSourceClass.Create;
FSourceClass.Source := -1;
FSourceClass.SourceClass := -1;
The SourceClass.Source and SourceClass.SourceClass properties can be set OK but when the form is saved to a database and reloaded the properties have defaulted back to -1. I don't think the problem is with the save/load routines as all the other properties are saved ok.
Could it be the declarations of TomxSourceID and TomxClassID?