|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
a a
|
Feb 6, 2006 - 4:57 AM
|
I have derived 2 times a CExtPropertyValue, overriden 2 times the Apply method. Lets consider ClassA derives from CExtPropertyValue and ClassB from ClassA, both overriding Apply. I instanciated a ClassB object. Just ClassA::Apply was called. May I know why? And Is there a work around for this? In C++ standards, ClassB::Apply should be called.
|
|
Technical Support
|
Feb 6, 2006 - 11:36 AM
|
We know only two situations when the ClassB::Apply() may not be called: 1) Declaration of the ClassB::Apply() method is not exactly the same as the declaration of ClassA::Apply() . 2) The compiler/linker of any version of Visual C++ fails. We encountered this many times. The complete rebuild helps to fix this.
|
|
a a
|
Feb 6, 2006 - 5:58 PM
|
I also thought it was a visual c++ bug, so I ’ve rebuilt the project many times but no good. Hmmm... In fact, when I call Apply() myself, ClassB::Apply is called. So there is no problem with the declaration, and there is probably a problem somewhere else... Removing ClassA::Apply() causes CExtPropertyValue::Apply() to be called, though the debugger states the instanciated object is a ClassB. Calling Apply() manually results in a call to ClassB::Apply(). This is the first time I encounter such a stange behaviour.
I guess I’ll have to "integrate" ClassA to ClassB and derive directly from CExtPropertyValue...
|
|
a a
|
Feb 6, 2006 - 7:16 PM
|
This problem came from a bad template instanciation. Sorry.
|
|