#1 2022-09-14 09:40:23

flydev
Member
From: France
Registered: 2020-11-27
Posts: 50
Website

New example of `TimerEnable` ?

Hi,

I had a chunk of code that was calling `Client.TimerEnable` found on this thread made by @tbo (https://synopse.info/forum/viewtopic.ph … 681#p33681)

But after upgrading some weeks ago mORMot, i get the following error:

[dcc32 Error] frmMain.pas(255): E2009 Incompatible types: 'Parameter lists differ'

I see the that the signature defined in `mormot.rest.core` is the following now:

function TRest.TimerEnable(const aOnProcess: TOnSynBackgroundTimerProcess;  aOnProcessSecs: cardinal): TRestBackgroundTimer;

And my code was:

frmMain.Connect(pmSender: TSynBackgroundTimer; pmEvent: TWaitResult; const pmcMsg: RawUTF8);

I can't manage to get my brain getting the right call even after reading all the code comments sad   

can someone you give me a hint please ?

Last edited by flydev (2022-09-14 09:45:28)

Offline

#2 2022-09-14 14:09:33

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: New example of `TimerEnable` ?

Just define your event as such:

procedure TMainForm.OnBackgroundConnect(Sender: TSynBackgroundTimer;
    const Msg: RawUtf8)

That is, remove the TWaitEvent parameter in the method signature.

I tried to make it more explicit in the source comments:
https://github.com/synopse/mORMot2/commit/144f70dd

Offline

#3 2022-09-14 14:35:25

flydev
Member
From: France
Registered: 2020-11-27
Posts: 50
Website

Re: New example of `TimerEnable` ?

Thanks @ab smile

Offline

Board footer

Powered by FluxBB