?
Solved

getting list of properties/methods programmatically

Posted on 1998-11-14
7
Medium Priority
?
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 5

Expert Comment

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

Author Comment

by:waskb
ID: 1346868
Edited text of question
0
 

Author Comment

by:waskb
ID: 1346869
ronit's comment appears to answer my question. Thanks.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:waskb
ID: 1346870
Edited text of question
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1346871
Do you want me to post it as an answer?
0
 

Author Comment

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

Accepted Solution

by:
ronit051397 earned 600 total points
ID: 1346873
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 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