代码如下,getint64prop怎么提示属性不存在?unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,typinfo;type
  TTtest = class
  private
    fid:integer;
    fname:string;
  public
    property id:integer read fid write fid;
  end;  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
  tt: TTtest;
  j:integer;
begin
  tt:=TTtest.Create;
  tt.fid:=56782;
  tt.fname:='cao';
  j:=getint64prop(tt,'id');
  //j:=i;
  edit1.Text:=inttostr(j);
end;end.

解决方案 »

  1.   

      TTtest = class
      private
        fid:integer;
        fname:string;
        procedure SetID(Value:integer);
      public
        property id:integer read fid write SetID;
      end;....procedure Ttest.SetID(Value:integer);
    begin
      FID:=Value;
    end;这样就OK了.
      

  2.   

    我对getint64prop崩溃了,吗隔壁的,刚才让其从tpersistent继承并registerclass它,通过了,就把delphi7关了,本来想试试楼上的办法,结果打开delphi7又怎么都通不过了,总是property not exists
      

  3.   

    又行了,操,为什么需要从tpersistent继承才行?不懂
      

  4.   

    1、用TPersistent作为基类
    2、尝试用编译选项{$M+}{$M-},这才是关键所在,哈
    如:
    {$M+}
      TTtest = class
      private
        fid:integer;
        fname:string;
      published
        property id:integer read fid write fid;
      end;
    {$M-}