[Lazarus] Delphi-Lazarus compatible code including serial port?

Bo Berglund bo.berglund at gmail.com
Mon Oct 11 19:31:07 CEST 2010


On Mon, 11 Oct 2010 12:25:52 +0300, "Juha Manninen (gmail)"
<juha.manninen62 at gmail.com> wrote:

>On Monday 11 October 2010 00:47:56 Bo Berglund wrote:
>> Lazarus does not like TLogFont and I found it came from Windows so I
>> put a conditional there. But it only stepped to the next error:
>> GetObject is apparently a Windows defined method as well....
>> And on it goes (lfEscapement, lfOrientation, Handle,
>> CreateFontIndirect).
>
>Why didn't you use the improved Delphi converter in Lazarus trunk version as I 
>recommended earlier?
>
>It does: 'Windows' --> 'LCLIntf, LCLType, LMessages'
>
Thanks!
I manually added these conditionals to the uses section of the unit
that complained about the TLogFont and its properties:
{$IFDEF FPC}
  LCLIntf,
  LCLType,
  LMessages,
{$ELSE}
  Windows,
{$ENDIF}

With this in place the compiler did not stop there anymore! :-)

But now I am stuck at this code section, which has a similar cause I'm
sure:

  FPlotImage.Canvas.Brush.Color := clFill;
  FPlotImage.Canvas.Brush.Style := bsSolid;
  FPlotImage.Canvas.FloodFill(nX, nY, clOrg, fsSurface);

On the last line FPC complains: "Identifier not found "fsSurface""

In Delphi7 this constant is defined in Windows, but now when I have
replaced Windows by the three files you suggested it still does not
work. How can i find out where in Lazarus this constant is defined?

I might add that Google just leads me to bible quotes (Lazarus) or to
Delphi, which is not what I need...


Bo Berglund





More information about the Lazarus mailing list