i’ve defined event type:
TMyEvent = procedure(object: TMyClass) of object;
and in the same unit i have also a class definition:
TMyClass = class(TObject)
...
private
FOnXXX: TMyEvent;
protected
...
public
...
property OnXXX: TMyEvent read FOnXXX write FOnXXX;
published
{ Published declarations }
end;
If i try to compile i get ‘E2003 Undeclared identifier: ‘TMyEvent”.
In C++ i would use prototyping.
Is there a way to keep them in one unit together?
Sry, if it is a duplicate, but i really didn’t find any information about it.
Thanks in advance,
Peacelyk
You would forward declare the class before the event declaration:
Then you should include full declartion of
TMyClassto resolve the unsatisfied forward declaration.