Tom420
2008-06-29 18:13:44 UTC
It's not good practice to cross-post questions, but as I didn't get an
answer and I feel it's probably more appropriate here...
I'm not quite good at class inheritance and function override. I receive
a compiler error here which I don't understand.
class PACKAGE TMyControl : public TCustomControl
{
private:
protected:
virtual void __fastcall Paint(void);
virtual void __fastcall DoEnter(void); <---------
public:
__fastcall TMyControl(TComponent* Owner);
__published:
};
I get error message:
Virtual function '__fastcall TMyControl::DoEnter()' conflicts with base
class 'TWinControl'
Paint() is from TCustomControl, and works fine.
DoEnter() is from TWinControl (TCustomControl's ancestor)
I'm trying to override DoEnter() in order to display a carret when my
component receives focus.
answer and I feel it's probably more appropriate here...
I'm not quite good at class inheritance and function override. I receive
a compiler error here which I don't understand.
class PACKAGE TMyControl : public TCustomControl
{
private:
protected:
virtual void __fastcall Paint(void);
virtual void __fastcall DoEnter(void); <---------
public:
__fastcall TMyControl(TComponent* Owner);
__published:
};
I get error message:
Virtual function '__fastcall TMyControl::DoEnter()' conflicts with base
class 'TWinControl'
Paint() is from TCustomControl, and works fine.
DoEnter() is from TWinControl (TCustomControl's ancestor)
I'm trying to override DoEnter() in order to display a carret when my
component receives focus.