PDA

View Full Version : Delphi to Lazarus



cronodragon
01-12-2006, 06: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?

Regards!

Almindor
02-12-2006, 02: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).

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

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

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

Vincent
19-12-2006, 12: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.

dmantione
19-12-2006, 12: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.

cronodragon
19-12-2006, 12: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? :?

Vincent
19-12-2006, 12: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.