Board index » cppbuilder » Why do these constructors conflict?

Why do these constructors conflict?


2007-12-08 03:49:30 AM
cppbuilder88
I am trying to override the constructor for this object, but keep getting
this error:
C++ Error] DBComboBox1.h(85): E2113 Virtual function '_fastcall
TFieldProperty::TFieldProperty(const _di_IFormDesigner,int)' conflicts with
base class 'TPropertyEditor'
Here's the code:
//descendant declaration:
...
protected:
__fastcall virtual TFieldProperty(const _di_IFormDesigner ADesigner, int
APropCount);
...
//base declaration:
...
protected:
__fastcall virtual TPropertyEditor(const _di_IFormDesigner ADesigner,
int APropCount);
...
not real sure why these would be conflicting, as the documentation says that
this error occurs when the return type differs (obviously not, as they are
constructors) or calling convention differs (don't think so, either).
--
 
 

Re:Why do these constructors conflict?

Hello!
You wrote on Fri, 7 Dec 2007 13:49:30 -0600:
DP>not real sure why these would be conflicting, as the documentation says
DP>that this error occurs when the return type differs (obviously not, as
DP>they are constructors) or calling convention differs (don't think so,
Don't constructors return the instance they've constructed?
With best regards,
Eugene Mayevski
www.SecureBlackbox.com - the comprehensive component suite for
network security
 

Re:Why do these constructors conflict?

"Eugene Mayevski" < XXXX@XXXXX.COM >wrote in message
Quote
Don't constructors return the instance they've constructed?
Constructors never have a return type specified in code, as they never
explicitally return anything. They are a special case method that the
compiler handles differently than normal methods.
Gambit
 

{smallsort}

Re:Why do these constructors conflict?

"David Pratt" < XXXX@XXXXX.COM >wrote in message
Quote
I am trying to override the constructor for this object, but keep
getting this error:
C++ Error] DBComboBox1.h(85): E2113 Virtual function '_fastcall
TFieldProperty::TFieldProperty(const _di_IFormDesigner,int)'
conflicts with base class 'TPropertyEditor'
That error means that the signature of your constructor does not exactly
match the signature of the base class constructor, so you are not actually
overriding it correctly.
Gambit
 

Re:Why do these constructors conflict?

Hello!
You wrote on Fri, 7 Dec 2007 12:14:38 -0800:
??>>Don't constructors return the instance they've constructed?
RLT>Constructors never have a return type specified in code, as they never
RLT>explicitally return anything.
The question here is not about explicitly returning anythng, but about the
reasons for the compiler to return the error. So your comment doesn't seem
to be applicable.
With best regards,
Eugene Mayevski
www.SecureBlackbox.com - the comprehensive component suite for
network security
 

Re:Why do these constructors conflict?

"Eugene Mayevski" < XXXX@XXXXX.COM >wrote in message
Quote
The question here is not about explicitly returning anythng, but
about the reasons for the compiler to return the error. So your
comment doesn't seem to be applicable.
I was answering Eugene's question, not commenting on the error. I did that
in a separate reply.
Gambit