No inherited call of message methods in mode: {$mode objfpc}{$H+}
Original Reporter info from Mantis: reiner.sombrowsky
-
Reporter name: Reiner Sombrowsky
Original Reporter info from Mantis: reiner.sombrowsky
- Reporter name: Reiner Sombrowsky
Description:
In Ref-Doc (6.5.7) every message method is virtual. Thats why it must be allowed to call
the inherited method within an message methode.
in mode {mode delphi} it is possible, but not in mode {
mode objfpc}{$H+} .
There is an compiling error:
unit1.pas(45,11) Error: Wrong number of parameters specified for call to "CNCommand"
customcombobox.inc(1071,27) Error: Found declaration: CNCommand(var TLMCommand);
Here is a simple Lazarus-Program to reproduce it:
unit Unit1;
//{$mode delphi}
{mode objfpc}{
H+}
interface
uses
Classes, SysUtils, Forms, LMessages, Controls, Graphics, Dialogs, StdCtrls;
type
{ TMyComboBox }
TMyComboBox=class(TCustomComboBox)
private
procedure CNCommand(var TheMessage: TLMCommand); message CN_Command;
protected
procedure AdjustDropDown; override;
public
end;
{ TForm1 }
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
FMyCombo:TMyComboBox;
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TMyComboBox }
procedure TMyComboBox.CNCommand(var TheMessage: TLMCommand);
begin
inherited;
end;
procedure TMyComboBox.AdjustDropDown;
begin
inherited AdjustDropDown;
end;
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
FMyCombo:=TMyComboBox.Create(self);
with FMyCombo do begin
left:=8; top:=8;
with Items do begin
Add('Item1');
Add('Item2');
Add('Item3');
end;
Parent:=self;
end;
end;
end.
Mantis conversion info:
- Mantis ID: 37695
- Version: 2.0.10