getting list of properties/methods programmatically

is it possible to get a list of inherited properties, methods, etc. programmatically (possibly using typinfo unit)for any given class, eg TButton, to display in a listbox? I haven't been able to figure out how to use the typinfo unit in delphi 4. Is this also possible or preferable to use the editintf unit in the toolsapi? If so how?
waskbAsked:
Who is Participating?
 
ronit051397Connect With a Mentor Commented:
To list all published properties and methods of an Object.
From Chami's Tips:

uses TypInfo;

procedure ObjectInspector(Obj: TObject;  Items : TStrings );
var  n : integer;
      PropList: TPropList;
begin
    n := 0;                              {you can put tkAny instead}
    GetPropList(Obj.ClassInfo,  tkProperties + [ tkMethod ], @PropList );
    while( (Nil <> PropList[ n ]) and (n < High(PropList)) ) do
    begin
        Items.Add(PropList[ n ].Name + ': ' +PropList[ n ].PropType^.Name );
        Inc( n );
    end;
end;

0
 
ronit051397Commented:
For published properties see:  http://www.chami.com/tips/delphi/012497D.html
0
 
waskbAuthor Commented:
Edited text of question
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
waskbAuthor Commented:
ronit's comment appears to answer my question. Thanks.
0
 
waskbAuthor Commented:
Edited text of question
0
 
ronit051397Commented:
Do you want me to post it as an answer?
0
 
waskbAuthor Commented:
Yes you can post it as an answer. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.