🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.winforms.controls.using
Article #453

Re: WinForm Inheritance

#453
From: Mauro Venturini
Date: Wed, 06 Oct 2004 11:49
42 lines
2232 bytes
Inside a class procedure Self refers to class, not instance. So Self.Create
is, as the message states, a "polymorphic constructor calls".
This requires a polymorphic constructor that is TBaseWinForm.Create is to be
virtual and TBaseGridWinForm.Create its override.
Unfortunately, I think this upsets poor WinForm designer.
Probably you can solve the matter using a second named constructor chain,
that is
TBaseWinForm.VirtualCreate ... vitual, TBaseGridWinForm.VirtualCreate ...
override. That way

with Self.VirtualCreate do  begin
   Show;
end

should compile and work as intended.


"Stefanidis Dimitris" <distef01@yahoo.gr> wrote in message
news:4163d1ef$1@newsgroups.borland.com...
> Hello
>
> I'm creating an winForm as TBaseWinForm. Then i'm creating an child of it
as
> TBaseGridWinForm with an Grid on it.
> I'm adding class procedure on TBaseWinForm as CreateShow as
> with TBaseWinForm.Create do
>  begin
>   Show;
>  end
>
>
> When i call TBaseGridWinForm.CreateShow i saw only TBaseWinForm.
> Ok lat's say this happens becouse of  "TBaseWinForm.Create". But when i
try
> classic delphi
> call : With Self.Create do and etc than i get an compile error as :
> "Potentially polymorphic constructor calls must be virtual"
>
>
> Any ideas ???
>
> Thanks Dimitris
Technical Details
Message-ID: <4163dbba@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4163d1ef$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1eff29,6ddce9c1d82c0fb2
X-Google-Attributes: gid1eff29,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mauro Venturini" <mauro.venturini@ocem.com>
Newsgroups: borland.public.delphi.winforms.controls.using
References: <4163d1ef$1@newsgroups.borland.com>
Subject: Re: WinForm Inheritance
Date: Wed, 6 Oct 2004 13:49:17 +0200
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 195.250.227.226
Message-ID: <4163dbba@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1097063354 195.250.227.226 (6 Oct 2004 04:49:14 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail