View Full Version : Delphi to Lazarus

01-12-2006, 07:56 PM
I'm making a little test to see the posibility of porting my engine from Delphi to Lazarus, then later on to port it to another platform.

I used the Lazarus convertion tool, and the first problem I found is that Windows unit is gone... how can I use Win32 API functions? Should I set the unit search path to some Delphi's directory?


02-12-2006, 03:26 PM
You can't use winapi in unix. If you want to be Lazarus/windows only then just re-add the windows unit to uses section.

If you want to be cross-platform then use fpc specific rtl methods and/or {$ifdef} where needed.

There are now alot of nice abstraction units which alleviate some of the more common winapi stuff (eg: dynlibs unit).

02-12-2006, 03:28 PM
That's what I supposed. I'll check those units, thanks :D

19-12-2006, 12:58 PM
Some winapi functions are emulated in the LCLIntf unit.

19-12-2006, 01:10 PM
Is there a reference or guide for the multiplataform windows functions? :?

19-12-2006, 01:16 PM
Is there a reference or guide for the multiplataform windows functions? :?

Not really. http://lazarus-ccr.sourceforge.net/docs/lcl/lclintf/index-5.html shows them, but is not more than a list of functions.

For windows most of the time, they just point to the same name function from winapi, see msdn. For gtk there are emulations.

19-12-2006, 01:17 PM
What Win32 function do you need? The Win32-API is large, it depends on which functionality you need what replacement you need to use, and therefore which documentation you need.

19-12-2006, 01:24 PM
I just need the functions to create a window, like RegisterClass() and CreateWindow() (which I don't see in that list of functions), the functions to show, hide and measure the window, basically. On the other hand, I don't know if the message loop in windows still works for other platforms... is it emulated? :?

19-12-2006, 01:32 PM
No, these functions are not in the LCLIntf unit.

Note that this unit is to support porting running LCL applications which make occasional use of some winapi functions. The LCLIntf is not port application using the winapi directly.