Board index » delphi » why ActiveForm custom property cannot be persistent

why ActiveForm custom property cannot be persistent


2003-07-25 01:05:19 PM
delphi260
hello everyone,
i create an activex form by delphi, and i use Type library editor define
some custom properties. these properties can be found in object inspector
,but these properties are not persistent ,that is ,they cannot be stream in
dfm file.
if somebody can give me advice ,thank you advance.
in Type library editor, i define a property called mvItemListID, source code
is as follows ,
type
TActiveFormX = class(TActiveForm, IActiveFormX)
private
{ Private declarations }
FmvItemListID:integer;//****this is my own Field
FEvents: IActiveFormXEvents;
procedure ActivateEvent(Sender: TObject);
procedure ClickEvent(Sender: TObject);
procedure CreateEvent(Sender: TObject);
procedure DblClickEvent(Sender: TObject);
procedure DeactivateEvent(Sender: TObject);
procedure DestroyEvent(Sender: TObject);
procedure KeyPressEvent(Sender: TObject; var Key: Char);
procedure PaintEvent(Sender: TObject);
protected
{ Protected declarations }
procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage);
override;
procedure EventSinkChanged(const EventSink: IUnknown); override;
function Get_Active: WordBool; safecall;
function Get_AlignDisabled: WordBool; safecall;
function Get_AutoScroll: WordBool; safecall;
function Get_AutoSize: WordBool; safecall;
function Get_AxBorderStyle: TxActiveFormBorderStyle; safecall;
function Get_Caption: WideString; safecall;
function Get_Color: OLE_COLOR; safecall;
function Get_Cursor: Smallint; safecall;
// ......... there are many lines
procedure Set_Visible(Value: WordBool); safecall;
//**** the following 2 lines is my code
function Get_mvItemListID: Integer;safecall;
procedure Set_mvItemListID(Value: Integer);safecall;
public
{ Public declarations }
procedure Initialize; override;
end;
function TActiveFormX.Get_mvItemListID: Integer;
begin
Result:= FmvItemListID;
end;
procedure TActiveFormX.Set_mvItemListID(Value: Integer);
begin
FmvItemListID:=Value;
end;
 
 

Re:why ActiveForm custom property cannot be persistent

i build this activex Form as an OCX control. in another project i place this
ocx control in a form ,and i set property "mvItemListID " in object
inspector. but the value of "mvItemListID" cannot be save in dfm file.
please help me .