Solved

getting list of properties/methods programmatically

Posted on 1998-11-14
7
280 Views
Last Modified: 2010-04-04
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?
0
Comment
Question by:waskb
  • 4
  • 3
7 Comments
 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
For published properties see:  http://www.chami.com/tips/delphi/012497D.html
0
 

Author Comment

by:waskb
Comment Utility
Edited text of question
0
 

Author Comment

by:waskb
Comment Utility
ronit's comment appears to answer my question. Thanks.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:waskb
Comment Utility
Edited text of question
0
 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
Do you want me to post it as an answer?
0
 

Author Comment

by:waskb
Comment Utility
Yes you can post it as an answer. Thanks.
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 200 total points
Comment Utility
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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now