Am Dienstag, den 22.08.2006, 10:15 +0200 schrieb Graeme Geldenhuys:
On 8/21/06, Mattias Gaertner <[EMAIL PROTECTED]> wrote:
> > TTestObject.Create won't ever be called (only TBaseTestObject.Create
> > will be, but if I use TClass instead of TBaseTestClass, it also won't
> > be). It also makes no difference if I use TPersistent as base or
> > simply TObject. But the DoSomething call works nevertheless,
> > therefore it seems, that the VMT (and other stuff) is initialized
> > correctly, but my own constructor won't ever be called.
>
> Make 'Create' virtual.
>
> Mattias

Oops!  Didn't see this was already answered...

At the very first beginning of my thread, I wrote:
> I think, RTTI is very powerfull and there should be a way to do the same as above without a virtual
> constructor. But is it clean?

But you are the second one who said, I should use a virtual constructor, so it seems, that it is the cleanest way. :)

Greetings,
Albert

Reply via email to