Does someone have a Declare line for the SetTimer function on Windows?
It thought about making an example project for declares, but it doesn’t work.
I may have a little problem.
Declare Function SetTimer Lib "user32.dll" (hwnd As ptr, ID As Integer, delay As UInt32, callback As Ptr) As Integer
myTimerCallback = AddressOf Callback
Dim p As ptr = myTimerCallback
Log "Callback function: "+Str(p)
Dim n As Integer = SetTimer(Nil, &h87654321, 1000, p)
Log "Timer created: "+Str(n)
and the callback method:
Public Sub Callback(Arg1 as ptr, Arg2 as UInt32, Arg3 as ptr, Arg4 as UInt32)
#Pragma X86CallingConvention StdCall
#Pragma BackgroundTasks False
#Pragma StackOverflowChecking False
Dim d As New date
Log CurrentMethodName+": "+d.SQLDateTime
End Sub
I got the timer ID returned, but the callback is never invoked.