http://bugs.winehq.org/show_bug.cgi?id=8822
------- Additional Comments From vladimiroski@gmail.com 2007-03-07 16:59 ------- I had located the problem, and I confirm it's a Wine bug.
I'll try to explain (with VB6 code):
APIs used: Public Declare Function SetTimer _ Lib "user32" (ByVal hwnd As Long, _ ByVal nIDEvent As Long, _ ByVal uElapse As Long, _ ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer _ Lib "user32" (ByVal hwnd As Long, _ ByVal nIDEvent As Long) As Long
Usually, as you know, you call it by giving him the adress of the callback procedure.
In this case:
Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _ ByVal nIDEvent As Long, ByVal dwTimer As Long) ' Code End Sub
Then for example, you set the timer like this:
ID_Timer = SetTimer(0&, 0&, 1000, AddressOf TimerProc)
...................
Ok, so far all is good, but if the TimerProc is defined like a function instead a Sub it will crash in Wine (but it will be fine in Windows).
Summary:
Working Declaration:
Public Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _ ByVal nIDEvent As Long, ByVal dwTimer As Long) ' Code End Sub
Declaration that makes program crash:
Public Function TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _ ByVal nIDEvent As Long, ByVal dwTimer As Long) ' Code End Sub
I can write some VB6 code tests that express the problem if anybody wants.