Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jul : Indy 10 and TIdBaseComponent descendant constructors
| Subject: | Indy 10 and TIdBaseComponent descendant constructors |
| Posted by: | "Reiner" (slu..@yahoo.com) |
| Date: | Thu, 7 Jul 2005 16:27:54 |
I've just migrated a project from Indy 9 to Indy 10, thinking its better to
have the current code in the event of any bugs.
I have a control descended from TIdCustomHTTPServer/TIdHTTPServer and in
Indy 9 I had my own constructor. However this can't be done in Indy 10
(10.0.52) as the compiler complains with "Cannot override a static method".
Looking at the source and help it says "Create is reintroduced to trap the
condition where override constructors are used at compile time. This
technique does not work in .Net, but we always test in VCL so this will
catch it." I understand this has been done for .Net (which can't have params
in the constructor) - but I'm not using .Net. Why can't I override the
constructor?
How can I create the objects my class owns when the control is created?
As a workaround I added an extra procedure to initialise the things it needs
and call this in the form's FormCreate event.