Year^^,
'new' and virtual is working now.
A derived class can now implement a method with the same name as its parentclass.
Its handled like 'new' in c++.
for example if CTestClass implements Foo, and CRectangle is derived from CTestclass, CRectangle can now implement Foo aswell.
if you do:
CRectangle* LRect;
...
LRect.Foo(LRect);
This will call the method foo of CRectangle
and you can do this:
CRectangle* LRect;
CTestClass* LTest;
...
LTest = LRect;
LRect.Foo(LRect);
LTest.Foo(LTest);
for LTest, the Foo method of CTestClass is called.
BUT(for the same example as above):
If CTestClass declares Foo as virtual, in both cases Foo of CRectangle is called.
Another nice feature is "super".
If your class reimplements a parentsclass method, you can do this:
void CRectangle::Foo()
{
super(This);//will call Foo of CTestClass
//and go on with my stuff
}
Next step: implementing custom constructors.
Greets
Rackscha