Ben
This is a bit of my code to get event names for a 'property' editor
I have not tried publishing a 'procedure' but my TControlLink
(it links a property of a Control to a dataset parameter and refreshes it on
an event)
uses RTTI to action an event on an event
procedure TControlLinkEventNameProperty.GetValues(Proc: TGetStrProc);
var
ControlLink: TControlLink;
Events: PPropList;
I: Integer;
begin
ControlLink := TControlLink(GetComponent(0));
if ControlLink.Control <> nil then
begin
{ Allocate memory to hold the property list
array of records. }
Events := AllocMem(SizeOf(Events^));
try
{ Get the list of methods}
GetPropList(ControlLink.Control.ClassInfo, tkMethods, Events);
{ Loop through the list of methods and add the name to Proc}
I := 0;
while (Events^[I]<> nil) and (I < High(Events^)) do
begin
Proc(Events^[I].Name);
inc(I);
end;
finally
FreeMem(Events);
end;
end;
end;
----- Original Message -----
From: Ben Taylor <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Tuesday, 6 June 2000 10:53
Subject: [DUG]: rtti stuff
> Hi!
>
> does anyone have ideas on how to generate (at runtime)
> a list of procedure names in an object?
>
> I'm aware that for rtti to work, the procedures will
> have to be published, but i can only find references
> to using properties via rtti...
>
> fyi from the list i intend to use MethodAddress() to
> execute stuff from a script...
>
> Thanks,
> Ben.
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos -- now, 100 FREE prints!
> http://photos.yahoo.com
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz