Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2002, 03:48 AM
peter_pan peter_pan is offline
Member
 
Join Date: Oct 2001
Posts: 54
Default Cannot assign a TFont to a TFont

I get this error "Cannot assign a TFont to a TFont" when I try to preview some reports in runtime. It throws this error in the controls.pas file in the SetFont method.

any ideas??
Reply With Quote
  #2  
Old 06-10-2002, 04:30 AM
andyho andyho is offline
Senior Member
 
Join Date: Jul 2001
Posts: 1,446
Default RE: Cannot assign a TFont to a TFont

Are you sure that both TFont's are the same type? This error can only show up if you define a second TFont type which has the same name as the one in graphics.pas, but is different type. As that SetFont method in controls does a FFont.Assign(), thus uses the internal TFont object of the control for the assign, and the font.assign does the assign provided that value is a TFont (the one defined in graphics).

So to trace this problem: how do you assign the font? Or is that done internally already? Which report do you use, Quickreport?



Bye,
Andy

Don't forget to click accept if it helped
Reply With Quote
  #3  
Old 06-10-2002, 05:15 AM
peter_pan peter_pan is offline
Member
 
Join Date: Oct 2001
Posts: 54
Default RE: Cannot assign a TFont to a TFont

I use quickreport but I don`t assign any fonts anywhere.

As soon as I call report.preview it gives this error and I have no code in the report unit whatsoever to cause this error. Strange?

Could it be a mixup with delphi4 units or something with delphi4?
Reply With Quote
  #4  
Old 06-10-2002, 05:26 AM
andyho andyho is offline
Senior Member
 
Join Date: Jul 2001
Posts: 1,446
Default RE: Cannot assign a TFont to a TFont

A look at groups.google.com only showed one hit, and that seemed to be related with putting the Quickreport into a DLL, and then maybe using that DLL with a different version of Delphi... But I don't know if that's in any way related to what you're doing.

Bye,
Andy

Don't forget to click accept if it helped
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 07:52 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.