View Single Post
Re: C++ overriding methods using virtual
Old
  (#11)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: C++ overriding methods using virtual - 21-06-2004

Quote:
Originally Posted by Cheeseh
Thanks anyway, but I sorted the problem anyway by making my own setup() ( initialise method) instead of using the constructors, (as stefan said too :p). But it's a bizzare problem anyway...

In my bot code, I tried the same as...

CSuperClass::CSuperClass() instead of this->CSuperClass::CSuperClass()

And a problem arises there when you want to initialize stuff, it doesn't actually change the stuff you want to initialize...
I'd say you have not sorted the problem out, but instead found a work around.

In general, you cannot get away without the use of constructors/destructors if you want to use some of the more advanced features provided with classes.

It is possible there's a problem with the MVC compiler, but more likely the problem lies elsewhere, since it is absolutely neccessary that constructors/destructors work flawlessly, at least when used as intended (or expected).

Cheeseh, perhaps I do not understand what is going wrong. Can you show me another example, or give me more details? Does the problem go away without the use of the virtual function?

ps: I'd like to see your "normal" code that does not work as expected, not the code with the attempts to get around the problem - thanks


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut

Last edited by botmeister; 21-06-2004 at 18:20..
  
Reply With Quote