I have the following problem. I am creating a descendant of TRVGraphicItemInfo using CreateEx constructor, but the overridden Create constructor is never called. As a result, I cannot initialize additional properties:
AFAIK, virtual constructors do not work in the way you expect.
Yes, TRVGraphicItemInfo.CreateEx calls inherited Create(ARVData), i.e. constructor TRVRectItemInfo.Create(ARVData: TPersistent), which is virtual.
However, even if you override this constructor in your class, TRVGraphicItemInfo.CreateEx will call TRVRectItemInfo.Create: virtuality does not allow to replace the constructor here.
But even if this worked as you expect, it wouldn't have any effect. TRVGraphicItemInfo.CreateEx changes StyleNo after calling inherited Create, so your value would still be lost.
Solution: overwrite both Create and CreateEx constructors.
Yes, I am currently overriding both constructors. This issue is more about expected behavior: the Create constructor is usually interpreted as the main one, responsible for initializing all fields. All other constructors are interpreted as secondary (CreateEx). In my opinion, it would be logical to call Create without inherited in CreateEx — then there would be no need to rewrite both constructors. But this is just a recommendation