This is my point:
1) You cannot include an interface definition
procedure WMSize(var Message: TWMSize); message WM_SIZE;
because it is actually a dynamic method:
Remember that interface definition methods cannot be declared as virtual , dynamic , abstract, or overriding .
2) Including interface definition
procedure WMSize(var Message: TWMSize);
- This is nonsense, because this does not mean that the method signature should be implemented further.
Interface definition must be bare:
type IDoSomething = interface ['{EFE0308B-A85D-4DF3-889C-40FBC8FE84D0}'] procedure DoSomething1; end;
The following class definitions remain unchanged (the same for their implementation):
TMyCheckBox = class(TCheckBox, IDoSomething) procedure DoSomething1; procedure WMSize(var Message: TWMSize); message WM_SIZE; end; TMyRadioButton = class(TRadioButton, IDoSomething) procedure DoSomething1; procedure WMSize(var Message: TWMSize); message WM_SIZE; end; implementation procedure TMyCheckBox.DoSomething1; begin // end; procedure TMyCheckBox.WMSize(var Message: TWMSize); begin // end; { TMyRadioButton } procedure TMyRadioButton.DoSomething1; begin // end; procedure TMyRadioButton.WMSize(var Message: TWMSize); begin // end;
source share