Hello,
I just finished porting a Delphi 5 project (app. 5000 lines, nearly no GUI) to WinCE.
It took me the most time, to get a running FPC/Lazarus configuration. Porting the application was real fun :-)
Here are some points, which could be usefull for others:
I needed a random generator, which produces the same numbers as Delphi 5. The FPC random generator doesn't. I am not used to ARM assembler yet, so the assembler _RandInt Delphi procedure did not help me. I found the following, portable code, which seems to work perfect. The orignal author of the code is Robert Rossmair, I found it in de.comp.lang.delphi.non-tech:
function MUL(N, M: Cardinal): Int64;
var
i: Integer;
Temp: Int64;
begin
Result := 0;
Temp := N;
for i := 0 to 31 do
begin
if (M and 1) = 1 then // Bit i in M gesetzt
Result := Result + Temp;
Temp := Temp shl 1;
M := M shr 1;
end;
end;
function myrand(range:integer):integer;
var
edx : Integer;
begin
edx := RandSeed * $08088405;
Inc(edx);
RandSeed := edx;
Result := MUL(edx, Range) shr 32;
end;
The next thing, which took me some time, was opening a serial COM port. In Win32 one calls CreateFile('COM1', ...); in WinCE it is CreateFile('COM1:', ...);
Last but not least: I had to replace my GlobalAlloc, GlobalLock, GlobalUnlock and GlobalFree calls with the corresponding LocalAlloc, LocalLock, LocalUnlock and LocalFree calls.
Regards, Bernd.