lol!
Found my problem...
Anyone know how to call super class constructor WITHOUT messing up the bloody class???
Check this test program I made...
Code:
#include <stdio.h>
class CSuperClass
{
public:
virtual void override_me ()
{
printf("WRONG METHOD CALLED...WTF???\n");
return;
}
};
class CSubClass : public CSuperClass
{
public:
// mess_up is true, it will call the super classes constructor on me
// it isn't very useful in this case, but is very useful in other cases
CSubClass(bool mess_up)
{
if ( mess_up )
this->CSuperClass::CSuperClass();
}
void override_me ()
{
printf("CORRECT METHOD CALLED...WOOOT!!!\n");
return;
}
};
int main ( int argc, char **argv )
{
CSuperClass *pInstance1 = new CSubClass(false);
CSuperClass *pInstance2_messed = new CSubClass(true);
pInstance1->override_me();
pInstance2_messed->override_me();
delete pInstance1;
delete pInstance2_messed;
return 1;
}
You'll see that when you initialise when calling the super classes constructor messes up the class for some reason or another...
Now I need to make my own method to initialise instead of calling the super class constructor....
...