i buid these code for try build 1 timer with 1ms of precision:
these code works fine. i put in an activex control and stills works. but why i can't use 2 controls in same form(in same application not tested)?Code:Private Sub WaitMs(ByVal ms As Long) 'wait a given number of milliseconds Dim t As Currency Dim f As Currency Dim e As Currency Dim i As Long On Error Resume Next Do f = 0 t = 0 e = 0 QueryPerformanceFrequency f 'get number of counts/second t = f * ms / 1000# 'multiply f by number of seconds to get number of counts to wait QueryPerformanceCounter e 'get current count number e = e + t 'add number of counts to wait to current count 'API_DoEvents Do QueryPerformanceCounter t If t > e Then RaiseEvent Timer API_DoEvents Exit Do 'wait for current count to exceed e End If Loop If blnTimer = False Then Exit Do Loop End Sub
i have tested and i see that 1 timer stills works but the other not or chage it(the 1st timer is desactivated and the 2nd timer is actived)





Reply With Quote