Scalabium Software

SMExport/SMImport suites
Knowledge for your independence'.
Home Delphi and C++Builder tips


#73: How can I receive the list of published properties of component (part 1)?

If you needs a list of published properties for some component, you must use the GetPropInfos function in TypInfo unit. For example,

uses TypInfo;

procedure GetPublishedProperties(comp: TComponent; lst: TStrings);
var
  Props: PPropList;
  TypeData: PTypeData;
  i: Integer;
begin
  TypeData := GetTypeData(comp.ClassInfo);
  if (TypeData = nil) or (TypeData^.PropCount = 0) then Exit;

  GetMem(Props, TypeData^.PropCount * sizeof(Pointer));
  try
    GetPropInfos(comp.ClassInfo, Props);
    for i := 0 to TypeData^.PropCount-1 do
    begin
      with Props^[i]^ do
        lst.Add(Name);
    end;
  finally
    FreeMem(Props);
  end;
end;

PS: I started to develop the component like Object Inspector for SMReport Designer. So maybe in some future I'll finish it...


Published: April 19, 2000

See also
 
Excel Web-stream
Paradox Viewer
Clarion to Text converter
Protected Storage Viewer
Clarion Viewer
Paradox to MS Access converter
dBase Viewer
SMDBGrid
ABA Spreadsheet Convert
ABA Document Convert
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2025, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport advertising