type
TMyClass = class
type
PMyClass = ^TMyClass;
TMyEvent = procedure(Sender: PmyClass) of object;
public
FTest: TMyEvent;
procedure Test;
end;
procedure TMyClass.Test;
begin
FTest(@Self); //error!
end;
How do I do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What in the world are you trying to do? Of course you cannot call
FTestsince you haven’t assigned anyTMyEventto it yet! And arePMyClassandTMyEventreally supposed to be parts ofTMyClass?At least this works perfectly:
Of course, you can also have the
TMyEventin the same object: