Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

Problems compiling my project in unit Grids 10 years 10 months ago #5005

  • Bernd Klingesberger
  • Bernd Klingesberger's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
I have tried to compile my project but it was failing all the time in the unit Grids

C:\codetyphon\typhon\lcl\grids.pas(1878,39) Error: Illegal type conversion: "TFontStyles" to "LongInt"
C:\codetyphon\typhon\lcl\grids.pas(1886,17) Error: Illegal type conversion: "LongInt" to "TFontStyles"
procedure CfgSetFontValue(cfg: TXMLConfig; AKey: WideString; AFont: TFont);
begin
  cfg.SetValue(AKey + '/name/value', AFont.Name);
  cfg.SetValue(AKey + '/size/value', AFont.Size);
  cfg.SetValue(AKey + '/color/value', ColorToString(AFont.Color));
 --> cfg.SetValue(AKey + '/style/value', Integer(AFont.Style));
end;

procedure CfgGetFontValue(cfg: TXMLConfig; AKey: WideString; AFont: TFont);
begin
  AFont.Name := cfg.GetValue(AKey + '/name/value', 'default');
  AFont.Size := cfg.GetValue(AKey + '/size/value', 0);
  AFont.Color:= StringToColor(cfg.GetValue(AKey + '/color/value', 'clWindowText'));
--->  AFont.Style:= TFontStyles(cfg.GetValue(AKey + '/style/value', 0));
end;

Is there any trigger to tell the compiler that he could use the cast in the right way ?
Any hints are welcome.

Please Log in or Create an account to join the conversation.

Last edit: by Bernd Klingesberger.

Problems compiling my project in unit Grids 10 years 10 months ago #5006

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Please Sir give us more info
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Problems compiling my project in unit Grids 10 years 10 months ago #5007

  • Bernd Klingesberger
  • Bernd Klingesberger's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Sorry Sir, I cannot benefit you with any other informations. These errors were suddenly thrown, but I don't know why. The compiler cannot cast a set of values TFontStyles = set of (fsBold, fsItalic, fsStrikeOut, fsUnderline); to type integer. I have commented these lines out and than the compiler raises this error C:\codetyphon\typhon\lcl\interfaces\win32\win32callback.inc(1474,28) Error: Illegal type conversion: "LongWord" to "TOwnerDrawState". It's the same type of error as before.

Please Log in or Create an account to join the conversation.

Problems compiling my project in unit Grids 10 years 10 months ago #5008

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
CT version ?
Host OS ?
TargetOS-CPU ?
etc...
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Problems compiling my project in unit Grids 10 years 10 months ago #5009

  • Bernd Klingesberger
  • Bernd Klingesberger's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Yes of course. I misunderstood you. CT 4.6, win 7 x64, x86_64

Please Log in or Create an account to join the conversation.

Problems compiling my project in unit Grids 10 years 9 months ago #5093

  • Bernd Klingesberger
  • Bernd Klingesberger's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
I believe this behavior was created by a third party component.

Thx

Please Log in or Create an account to join the conversation.

  • Page:
  • 1