當我在這樣定義一個類德爾福7:的ClassInfo功能在Delphi 7
TPerson = class(TObject)
private
FLName: string;
FFName: string;
FAge: integer;
FBDate: TDate;
public
published
property FName: string read FFName write FFName;
property LName: string read FLName write FLName;
property Age: integer read FAge write FAge;
property BDate: TDate read FBDate write FBDate;
end;
procedure ListComponentProperties(AObject: TObject; Strings: TStrings);
var
Count, Size, I: Integer;
List: PPropList;
PropInfo: PPropInfo;
PropValue: string;
begin
Count := GetPropList(AObject.ClassInfo, tkAny, List);
Size := Count * SizeOf(Pointer);
GetMem(List, Size);
try
Count := GetPropList(AObject.ClassInfo, tkAny, List);
for I := 0 to Count - 1 do
begin
PropInfo := List^[I];
PropValue := VarToStr(GetPropValue(AObject, PropInfo^.Name));
end;
finally
FreeMem(List);
end;
end;
,我想它的出版性質與ListComponentProperties的錯誤信息會displayed.The錯誤列表是關係到下面的命令和AObject.ClassInfo:
Count := GetPropList(AObject.ClassInfo, tkAny, List);
任何幫助將不勝感激。
將來,當您提出有關錯誤消息的問題時,請在您的問題中包含錯誤消息,逐字引用。 –