[Lazarus] How do I fix win32object.inc errors compiling Win64 Lazarus trunk+FPC trunk?

Reinier Olislagers reinierolislagers at gmail.com
Thu Oct 11 09:46:16 CEST 2012


Building Laz trunk+FPC trunk on Windows I get

win32object.inc(565,78) Error: Incompatible type for arg no. 4: Got
"<address of procedure(QWord;LongWord;LongWord;LongWord);StdCall>",
expected "<procedure variable type of
procedure(QWord;LongWord;QWord;LongWord);StdCall>"
win32int.pp(328) Fatal: There were 1 errors compiling module, stopping

Probably due to FPC trunk FPC r22526
Eg changes like
-function SetTimer(hWnd:HWND; nIDEvent:UINT; uElapse:UINT;
lpTimerFunc:TIMERPROC):UINT; external 'user32' name 'SetTimer';
+function SetTimer(hWnd:HWND; nIDEvent:UINT_PTR; uElapse:UINT;
lpTimerFunc:TIMERPROC):UINT_PTR; external 'user32' name 'SetTimer';

My pointer magic is still weak - what do I need to modify here:
I obviously need to go from the pointer to the UINT to the UINT itself,
but my messing with @ didn't work...

function TWin32WidgetSet.CreateTimer(Interval: integer; TimerFunc:
TWSTimerProc) : THandle;
...
    {$IF FPC_FULLVERSION>=20701}
    // Windows function fixes in FPC r22526
    TimerInfo^.TimerID := Windows.SetTimer(0, 0, Interval,
@TimerCallBackProc);
    {$ELSE}
    TimerInfo^.TimerID := Windows.SetTimer(0, 0, Interval,
@TimerCallBackProc);
    {$ENDIF}


Thanks,
Reinier




More information about the Lazarus mailing list