RE: [DUG]: polymorphism problem

2002-10-17 Thread Jianming Lin (ASL)
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

Re: [DUG]: polymorphism problem

2002-10-17 Thread Terry Johnson
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

Re: [DUG]: polymorphism problem

2002-10-17 Thread Dennis Chuah
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

RE: [DUG]: polymorphism problem

2002-10-17 Thread Jianming Lin (ASL)
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

RE: [DUG]: polymorphism problem

2002-10-17 Thread Jianming Lin (ASL)
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

RE: [DUG]: polymorphism problem

2002-10-17 Thread Andreas Toth
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

Re: [DUG]: polymorphism problem

2002-10-17 Thread Dennis Chuah
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

Re: [DUG]: polymorphism problem

2002-10-17 Thread Dennis Chuah
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

RE: RE: [DUG]: polymorphism problem

2002-10-17 Thread Jianming Lin (ASL)
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

RE: RE: [DUG]: polymorphism problem

2002-10-17 Thread Andreas Toth
>-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

RE: RE: [DUG]: polymorphism problem

2002-10-17 Thread Jianming Lin (ASL)
; > > > >-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

2002-10-17 Thread Andreas Toth
: RE: [DUG]: polymorphism problem More Examples of my problem: // Type TMyGraphic = class(TGraphic) public constructor Create; override; end; constructor TMyGraphic.Create; begin inherited; ShowMessage(&#x

Re: RE: [DUG]: polymorphism problem

2002-10-17 Thread Chris Reynolds
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]

Re: RE: [DUG]: polymorphism problem

2002-10-17 Thread Chris Reynolds
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

RE: [DUG]: polymorphism problem

2002-10-17 Thread Jianming Lin (ASL)
.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

RE: [DUG]: polymorphism problem

2002-10-17 Thread Andreas Toth
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

RE: [DUG]: polymorphism problem

2002-10-17 Thread Jianming Lin (ASL)
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

RE: [DUG]: polymorphism problem

2002-10-17 Thread Jianming Lin (ASL)
-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

Re: [DUG]: polymorphism problem

2002-10-17 Thread Dennis Chuah
? 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

Re: [DUG]: polymorphism problem

2002-10-17 Thread Nello Sestini
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

RE: [DUG]: polymorphism problem

2002-10-16 Thread Kyley Harris
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

RE: [DUG]: polymorphism problem

2002-10-16 Thread Jeremy North
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

RE: [DUG]: polymorphism problem

2002-10-16 Thread Jianming Lin (ASL)
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

Re: [DUG]: polymorphism problem

2002-10-16 Thread Nello Sestini
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

RE: [DUG]: polymorphism problem

2002-10-16 Thread Kyley Harris
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

[DUG]: polymorphism problem

2002-10-16 Thread Jianming Lin (ASL)
  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