I need a smooth and fast timer for this i done something and used timesetevent api its work fine but the problem is like
Public Const TIME_ONESHOT = 0
Public Const TIME_PERIODIC = 1
Public Const TIME_CALLBACK_EVENT_PULSE = &H20
Public Const TIME_CALLBACK_EVENT_SET = &H10
Public Const TIME_CALLBACK_FUNCTION = &H0
Public Declare Function timeKillEvent Lib "winmm.dll" (ByVal uID As Long) As Long
Public Declare Function timeSetEvent Lib "winmm.dll" (ByVal uDelay As Long, ByVal uResolution As Long, ByVal lpFunction As Long, ByVal dwUser As Long, ByVal uFlags As Long) As Long
Public hMMTimer As Long
'This is the timerproc which will fire on timerevent
Sub TimerProc(ByVal uID As Long, ByVal uMsg As Long, ByVal dwUser As Long, ByVal dw1 As Long, ByVal dw2 As Long)
Form1.Caption = Time
Private Sub Form_Load()
hMMTimer = timeSetEvent(1, 0, AddressOf TimerProc, 0, TIME_PERIODIC Or TIME_CALLBACK_FUNCTION)
Private Sub Form_Unload(Cancel As Integer)
Problem its working fine when im doing 'some calcualtion in timerproc when i m calling another method from timerproc it works in vb enviroment and application crashes in EXE like the above example it will work in vb enviroment and will crash in exe..
and when i just perform some calculation not call any other function from timerproc then it work fine in both exe and vb enviroment.
i need to know why its happening in exe file..
this technique is very good to get smooth and fast timer..
please help me i need hurry
or is there any other way to get smooth and fast timer other then SetTimer and killtimer apis (its not smooth and fast)
waithing to replay.