Solved

getting list of properties/methods programmatically

Posted on 1998-11-14
7
285 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 200 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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 is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

707 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