Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-09

Declare a standalone procedure of object (TNotifyEvent)

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luiz Americo Pereira Camara

I'm trying to declare a standalone function (not attached to a class) to use as a TNotifyEvent.

I tried

procedure FooBar of object;
begin
end;

Without sucess.

Is it possible to declare such function to use as a TNotifyEvent without creating a class only to hold the callback method?

Luiz

Reply by email

Jonas Maebe
to Luiz Americo Pereira Camara
Luiz Americo Pereira Camara wrote 8 lines
procedure FooBar of object; begin end; Without sucess. Is it possible to declare such function to use as a TNotifyEvent without creating a class only to hold the callback method?

Not without unsupported ugly hacking and explicit typecasting.

Jonas

Reply by email