Thanks a lot, Dennis.
-Original Message-
From: Dennis Chuah [mailto:dennis_cs_chuah@;hotmail.com]
Sent: Friday, 18 October 2002 12:05 p.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: polymorphism problem
TGraphicClass provides you with the same scope as TGraphic, from
Somebody correct me if I'm wrong here, but I think your problem is due
to classes not having a virtual method structure in the way that
instances do - the type cast mechanism returns a concrete class, and the
class explicitly defines the constructor. So if the TGraphicClass
constructor ever did
ECTED]>
Sent: Friday, October 18, 2002 11:49 AM
Subject: RE: [DUG]: polymorphism problem
> Dear Dennis,
>
> I read the help of Delphi, it says :
> A protected member is visible anywhere in the module where its class is
> declared
> and from any descendant class, regardless of
myPic := TPicture.Create;
myPic.Graphic := nGra;
ShowMessage(IntToStr(CallNo)); // 1
end;
-Original Message-
From: Jianming Lin (ASL) [mailto:JianmingL@;aslnz.co.nz]
Sent: Friday, 18 October 2002 11:20 a.m.
To: Multiple recipients of list delphi
Subject: RE: [DUG]: polymorphism problem
Dear D
list delphi
Subject: Re: [DUG]: polymorphism problem
I stepped through your code in D6 (don't have D5 installed on this
machine) - but perhaps there is something wrong in D5? I am wondering in D5
whether TGraphic's constructor is protected?
Dennis.
- Original Message -
From: &qu
You learn something new everyday. Thanks!
-Andreas
-Original Message-
From: [EMAIL PROTECTED] [mailto:owner-delphi@;delphi.org.nz]On
Behalf Of Dennis Chuah
Sent: Friday, 18 October 2002 10:59
To: Multiple recipients of list delphi
Subject: Re: [DUG]: polymorphism problem
The is
OTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Friday, October 18, 2002 9:10 AM
Subject: RE: [DUG]: polymorphism problem
>
>
> -Original Message-
> From: Dennis Chuah [mailto:dennis_cs_chuah@;hotmail.com]
> Sent: Friday, 18 Octobe
dreas Toth" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Friday, October 18, 2002 9:17 AM
Subject: RE: [DUG]: polymorphism problem
> Have I missed something, or, is the third point suggesting a rather odd
> technique of te
Another example for clearifying my problem :
var CallNo : Integer;
Type TMyGraphic = class(TGraphic)
public
constructor Create; override;
procedure Assign(Source: TPersistent); override;
end;
procedure TMyGraphic.Assign(Source: TPersistent);
begin
//
end;
constructor TMyGraphic.Create
>-Original Message-
>From: Dennis Chuah [mailto:dennis_cs_chuah@;hotmail.com]
>Sent: Friday, 18 October 2002 7:14 a.m.
>To: Multiple recipients of list delphi
>Subject: Re: [DUG]: polymorphism problem
>
>
>
>I stepped through your code and it *DEFINITELY* calls T
;
>
>
>
>-Original Message-
>From: Dennis Chuah [mailto:dennis_cs_chuah@;hotmail.com]
>Sent: Friday, 18 October 2002 7:14 a.m.
>To: Multiple recipients of list delphi
>Subject: Re: [DUG]: polymorphism problem
>
>
>
>I stepped through your code and it *D
: RE: [DUG]: polymorphism problem
More Examples of my problem:
//
Type TMyGraphic = class(TGraphic)
public
constructor Create; override;
end;
constructor TMyGraphic.Create;
begin
inherited;
ShowMessage(
Try 2
>Only just focussed on this thread after deleting several previous.
>Maybe I missed that message but how is TGraphicClass declared?
>
>
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Original Message-
>From: Dennis Chuah [mailto:dennis_cs_chuah@;hotmail.com]
>Sent: Friday, 18 October 2002 7:14 a.m.
>To: Multiple recipients of list delphi
>Subject: Re: [DUG]: polymorphism problem
>
>
>
>I stepped through your code and it *DEFINITELY* calls TMetadat
.m.To: Multiple recipients of list delphiSubject:
RE: [DUG]: polymorphism problem
The
code does work. add a line as this is to test
NGraphic :=
GraphicClass.Create;
Assert(NGraphic is TMetaFile,'NGraphic not created as
tmetafile');
as
jeremy pointed ou
Dennis Chuah
Sent: Friday, 18 October 2002 07:14
To: Multiple recipients of list delphi
Subject: Re: [DUG]: polymorphism problem
I stepped through your code and it *DEFINITELY* calls TMetadata.Create.
What you have done looks correct and this is certainly not a polymorphism
pproblem. Few
yGraphic.Create; // called successfully
end;
-Original Message-
From: Dennis Chuah [mailto:dennis_cs_chuah@;hotmail.com]
Sent: Friday, 18 October 2002 7:14 a.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: polymorphism problem
I stepped through your code and it *DE
-Original Message-
From: Dennis Chuah [mailto:dennis_cs_chuah@;hotmail.com]
Sent: Friday, 18 October 2002 7:14 a.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: polymorphism problem
I stepped through your code and it *DEFINITELY* calls TMetadata.Create.
What you have
?
Dennis.
- Original Message -
From: Jianming Lin (ASL)
To: Multiple recipients of list delphi
Sent: Thursday, October 17, 2002 4:35 PM
Subject: [DUG]: polymorphism problem
G'Day, guys,
procedure TryMetadata(ImgType : Integer);
var NGraphic: TGraphic;
GraphicClass: TGraphic
tober 17, 2002 11:43
Subject: RE: [DUG]: polymorphism problem
>
> do you have blue balls in the editor gutter in the delphi source?
> Is the source\vcl folder in your library path?
>
> JED
>
> >Why constructor of TMetafile.Create is not called instead only
> TObject.Crea
and debug
-Original Message-From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of
Jianming Lin (ASL)Sent: Thursday, 17 October 2002 5:33
p.m.To: Multiple recipients of list delphiSubject: RE:
[DUG]: polymorphism problem
I am afraid you
misunderstood my purpose. No
do you have blue balls in the editor gutter in the delphi source?
Is the source\vcl folder in your library path?
JED
>Why constructor of TMetafile.Create is not called instead only
TObject.Create is called?
>if TMetafile.Create is called, why I put I breakpoint in the source code
of Graphics.p
Surely, my Compiler -> use Debug Dcus is
on.
-Original Message-From: Nello Sestini
[mailto:[EMAIL PROTECTED]]Sent: Thursday, 17 October 2002 5:00
p.m.To: Multiple recipients of list delphiSubject: Re:
[DUG]: polymorphism problem
I agree with Kyley - the code as written alw
TBitMap.Create gets
called if you pass
2
-nshttp://www.roserox.co.th
- Original Message -
From:
Kyley
Harris
To: Multiple recipients of list delphi
Sent: Thursday, October 17, 2002
10:42
Subject: RE: [DUG]: polymorphism
problem
TMetafile.create should get
2002 4:36
p.m.To: Multiple recipients of list delphiSubject:
[DUG]: polymorphism problem
G'Day, guys,
procedure TryMetadata(ImgType : Integer);var
NGraphic: TGraphic; GraphicClass:
TGraphicClass;begin
ImgType := 1; ca
G'Day, guys,
procedure TryMetadata(ImgType : Integer);var
NGraphic: TGraphic; GraphicClass:
TGraphicClass;begin
ImgType := 1; case ImgType
of 1 : GraphicClass :=
TMetaFile; 2 : GraphicClass :=
TBitmap; end; NGraphic := Graphic
26 matches
Mail list logo