Code: Select all
Vcl.Controls.hpp
class PASCALIMPLEMENTATION TGraphicControl : public TControl
{
typedef TControl inherited;
private:
Vcl::Graphics::TCanvas* FCanvas;
MESSAGE void __fastcall WMPaint(Winapi::Messages::TWMPaint &Message);
protected:
virtual void __fastcall Paint();
__property Vcl::Graphics::TCanvas* Canvas = {read=FCanvas};
public:
__fastcall virtual TGraphicControl(System::Classes::TComponent* AOwner);
__fastcall virtual ~TGraphicControl();
};
< /code>
Infolgeclass MyControl : public TGraphicControl
{
public:
MyControl(TComponent *Owner);
void __fastcall Paint() override;
};
< /code>
Der Compiler gibt diese Warnungen aus: < /p>
MyControl.h(18): 'MyControl' überschreibt eine Mitgliedsfunktion ist jedoch nicht mit 'override'
vcl.controls.hpp(2642): Die überschreibende virtuelle Funktion ist hier < /p>
< /blockquote>
Weird! Ist das eine Delphi -Sprachweiterung? Und wenn ja, welche Art von virtueller Mitgliedsfunktion wird der Compiler vom virtuellen Konstruktor generieren? Oder ist es nur eine Inkonsistenz in der Compiler -Implementierung?