Title: Message
$(DELPHI)\Source\VCL is added. Dosn't work.
run Assert(NGraphic is TMetaFile,'NGraphic not created as tmetafile')
no error message showed.
 
 
-----Original Message-----
From: Kyley Harris [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 17 October 2002 6:40 p.m.
To: Multiple recipients of list delphi
Subject: 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 out. your library path must include
 
$(DELPHI)\Source\VCL
 
to be able to trace 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 delphi
Subject: RE: [DUG]: polymorphism problem

I am afraid you misunderstood my purpose. Now I change the code to this:
 
procedure TryMetadata;
var NGraphic: TGraphic;
    GraphicClass: TGraphicClass;
begin
    GraphicClass := TMetaFile;
   NGraphic := GraphicClass.Create; 
end;
 
 
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.pas at the TMetafile.Create,
Delphi dosn't stop there? or Press F7 at line NGraphic := GraphicClass.Create, Dephi won't go to TMetafile.Create. ?
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 delphi
Subject: Re: [DUG]: polymorphism problem

I agree with Kyley - the code as written always calls the TMetafile.Create
because ImgType is always forced := 1  (ignoring the value passed as a parameter
to the procedure)
 
If you remove the
       ImgType := 1;
then TMetaFile.Create gets called if you pass 1 and TBitMap.Create gets
called if you pass 2
 
 
 
----- Original Message -----
Sent: Thursday, October 17, 2002 10:42
Subject: RE: [DUG]: polymorphism problem

TMetafile.create should get called, and does if i test your code?? sorry can't help,  but your example is functioning correctly
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jianming Lin (ASL)
Sent: Thursday, 17 October 2002 4:36 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: polymorphism problem


 
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 := GraphicClass.Create; 
end;
 
 
Why constructor  of TMetafile.Create is not called instead only TObject.Create is called?
 
 
 
  
[Jianming Lin (ASL)] 
 
 
  

This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal - For more information please visit www.marshalsoftware.com

This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal - For more information please visit www.marshalsoftware.com

This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal - For more information please visit www.marshalsoftware.com

Reply via email to