?
Solved

getting list of properties/methods programmatically

Posted on 1998-11-14
7
Medium Priority
?
289 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

650 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