I need to hide constructor Create from base class TObject, when children
class have more that one constructor.
Example:
TObjectA = class(TObject)
public
Construtor Create(AAA:string); overload;
Construtor Create(BBB:integer); overload;
end;
In this case when I see TObject.Create also as available constructor for
TObjectA.
Example:
var
CC:TObjectA;
begin
CC:=TObjectA.Create; <= I need to hide this constructor. TObjectA.Create is
extremely unacceptable for me.
Any idea - how??
Regards,
Iv
> I need to hide constructor Create from base class TObject, when children
> class have more that one constructor.
> Example:
> TObjectA = class(TObject)
> public
> Construtor Create(AAA:string); overload;
> Construtor Create(BBB:integer); overload;
> end;
> In this case when I see TObject.Create also as available constructor for
> TObjectA.
> Example:
> var
> CC:TObjectA;
> begin
> CC:=TObjectA.Create; <= I need to hide this constructor.
> // TObjectA.Create is extremely unacceptable for me.
> Any idea - how??
IvKo,
From whom do want to hide the TObject.Create constructor?
In what context, do you want to hide the constructor?
Regards, JohnH
> I need to hide constructor Create from base class TObject, when children
> class have more that one constructor.
http://www.delphi3000.com/articles/article_990.asp?SK=
danny
---
You can only hide an ancestor method with public visibility if you
provide a new version of it, e.g.
TObjectA = class(TObject)
public
Constructor Create(AAA:string); overload;
Constructor Create(BBB:integer); overload;
Constructor Create; overload;
end;
with an implementation like
constructor.TObjectA.Create;
begin
raise Exception.Create('Don''t use this constructor you dummy!');
end;
--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
"Peter Below (TeamB)" <no...@nomail.please> wrote in message
news:xn0fqdlg...@newsgroups.borland.com...