Hi.

> I wrote some components for use in delphi,

Im also starting to migrate my delphi components to Lazarus.

> is there any special things to note in conversions?

First, of all, by components do you mean "Visual controls" or
just "drag and drop non visual components"  ?

The first thing you may encounter is that the packages where
the components are stored, in Lazarus are STATICALLY compiled,
that means there're NOT DLL (shared libraires) like windowze.

That means you have to compile Lazarus IDE with your component's
packages in order to use them in Lazarus.

> As they are visual and do respond mostly to lots of windows messages?

Yes, "windowze messages" doesn't exist in Linux.

You will have to change the "message" handlers procedures in your
control's code to be "message-independent".

Example:

Original code:
------------
type
  TMyControl = class
    procedure WMSize; message WM_Size;
  end;

procedure TMyControl.WMSize;
begin
  // ...
  // my stuff to answer to "WM_Size" message.
end;
------------

To temporal new code:
------------
type
  TMyControl = class
    procedure WMSize; message WM_Size;

    procedure DoSize;
  end;

procedure TMyControl.WMSize;
begin
  DoSize;
end;

procedure TMyControl.DoSize;
begin
  // ...
  // my stuff to answer to "WM_Size" message.
end;
------------

Try this first, in your DELPHI code. When you have this modifications,
working in Delphi, then you can make your code platform independent.

Example:

Temporal new code:
------------
type
  TMyControl = class
    {$ifdef Windowze}
    procedure WMSize; message WM_Size;
    {$endif}

    {$ifdef QT}
    procedure QTSize;
    {$endif}

    procedure DoSize;
  end;

{$ifdef Windowze}
procedure TMyControl.WMSize;
begin
  DoSize;
end;
{$endif}

{$ifdef Windowze}
procedure TMyControl.QTSize;
begin
  DoSize;
end;
{$endif}

procedure TMyControl.DoSize;
begin
  // ...
  // my stuff to answer to "WM_Size" message.
end;
------------

It's not exactly, but it's the general idea.

You'll have to check Lazarus and FPC documentation, to find
each winzowze message equivalent.

> and if i just wanted it to be working on win32 also should i change
> things?

Yes, I started to migrate my components in Kylix, and it was the same
problem.

Just my 2 cents.

-----
Marco Aurelio Ramirez Carrillo
lazarus dot mramirez at star-dev dot com [dot mx]

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to