Heres the code for a method in the Techinsite OPF that returns a list of
Published properties. The guts is in the typinfo unit --- haven't really
tried to understand it, seems straightforward enough though:

procedure tiGetPropertyNames( pPersistent : TPersistentClass ;
                              pSL : TStringList ;
                              pPropFilter : TTypeKinds = ctkSimple ) ;
var
  lCount : integer ;
  lSize  : integer ;
  lList  : PPropList ;
  i : integer ;
  lPropFilter : TTypeKinds ;
begin

  Assert( pSL <> nil, 'pSL not assigned.' ) ;
  lPropFilter := pPropFilter ;

  pSL.Clear ;

  lCount := GetPropList(pPersistent.ClassInfo, lPropFilter, nil);
  lSize := lCount * SizeOf(Pointer);
  GetMem(lList, lSize);
  try
    GetPropList(pPersistent.ClassInfo, lPropFilter, lList);
    for i := 0 to lcount - 1 do
      psl.add( lList[i].Name ) ;
  finally
    FreeMem( lList, lSize ) ;
  end ;
end ;

Regards

-----Original Message-----
From: Rohit Gupta [mailto:[EMAIL PROTECTED]]
Sent: 26 September 2002 08:08
To: Multiple recipients of list delphi
Subject: [DUG]: RTTI


I cant seem to find it right now....but how do I find out if a control has a

particular published property and how do I access it ?
Regards

Rohit

======================================================
================
CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New 
Zealand
PH    (649) 489-2280 
FX    (649) 489-2290
email [EMAIL PROTECTED]  or  [EMAIL PROTECTED]
======================================================
================


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
Notice of Legal Status and Confidential Information: This electronic mail
message and any accompanying attachments may contain information that is
privileged and CONFIDENTIAL.  If you are not the intended recipient you are
advised that any use, review, dissemination, distribution or reproduction of
the information is strictly prohibited and may be unlawful.  If you have
received this document in error, please notify the sender immediately and
destroy the message.
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to