Post by Thor on Nov 25, 2005 19:48:41 GMT -5
Hi there, I exerienced that the app is freezing after a certaint number of enable and disable on the ticker.
I just replaced the ticker with a timer class(written in pure vb,and using some api calls) and now the freeze is gone, so it must be something with the vbcorelib ticker.
I created a class that would hold the timer.
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "ArielTimer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'** VBcore time ticker class
'** www.kellyethridge.com/vbcorlib/
Private WithEvents mTicker As Ticker
Attribute mTicker.VB_VarHelpID = -1
Private mEnabled As Boolean 'Timer running?
Private mInterval As Long 'Timer interval, ms
Public Event OnTimer()
Public Property Get Enabled() As Boolean
'----------------------------------------
'Read current Enabled status
'----------------------------------------
Enabled = mEnabled
End Property
Public Property Let Enabled(ByVal vEnabled As Boolean)
'-----------------------------------------------------
'Reset and Enable timer
'-----------------------------------------------------
If mEnabled <> vEnabled Then mTicker.Enabled = vEnabled
mEnabled = vEnabled
End Property
Public Property Let Interval(vInterval As Long)
'-----------------------------------------------
'Set new interval & reset timer
'-----------------------------------------------
If vInterval > 0 Then
mInterval = vInterval
mTicker.Interval = mInterval
End If
End Property
Private Sub mTicker_Elapsed(ByRef Data As Variant)
RaiseEvent OnTimer
End Sub
Public Property Get Interval() As Long
'----------------------------------------
'Read current Interval
'----------------------------------------
Interval = mInterval
End Property
Private Sub Class_Initialize()
'--------------------------------
'Initialise Timer
'--------------------------------
mEnabled = False: mInterval = 1000
Set mTicker = NewTicker(mInterval)
End Sub
Private Sub Class_Terminate()
'------------------------------------
'Terminate timer
'------------------------------------
mEnabled = False: mTicker.StopTicker
Set mTicker = Nothing
End Sub
I haven't tried to check if the freeze is gone if I don't use the class.But I can't understand if that would make it different?
any ideas?
other than that I would like to say thank you for putting so much work in making such a lib.impressive.
Have a nice holyday.
I just replaced the ticker with a timer class(written in pure vb,and using some api calls) and now the freeze is gone, so it must be something with the vbcorelib ticker.
I created a class that would hold the timer.
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "ArielTimer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'** VBcore time ticker class
'** www.kellyethridge.com/vbcorlib/
Private WithEvents mTicker As Ticker
Attribute mTicker.VB_VarHelpID = -1
Private mEnabled As Boolean 'Timer running?
Private mInterval As Long 'Timer interval, ms
Public Event OnTimer()
Public Property Get Enabled() As Boolean
'----------------------------------------
'Read current Enabled status
'----------------------------------------
Enabled = mEnabled
End Property
Public Property Let Enabled(ByVal vEnabled As Boolean)
'-----------------------------------------------------
'Reset and Enable timer
'-----------------------------------------------------
If mEnabled <> vEnabled Then mTicker.Enabled = vEnabled
mEnabled = vEnabled
End Property
Public Property Let Interval(vInterval As Long)
'-----------------------------------------------
'Set new interval & reset timer
'-----------------------------------------------
If vInterval > 0 Then
mInterval = vInterval
mTicker.Interval = mInterval
End If
End Property
Private Sub mTicker_Elapsed(ByRef Data As Variant)
RaiseEvent OnTimer
End Sub
Public Property Get Interval() As Long
'----------------------------------------
'Read current Interval
'----------------------------------------
Interval = mInterval
End Property
Private Sub Class_Initialize()
'--------------------------------
'Initialise Timer
'--------------------------------
mEnabled = False: mInterval = 1000
Set mTicker = NewTicker(mInterval)
End Sub
Private Sub Class_Terminate()
'------------------------------------
'Terminate timer
'------------------------------------
mEnabled = False: mTicker.StopTicker
Set mTicker = Nothing
End Sub
I haven't tried to check if the freeze is gone if I don't use the class.But I can't understand if that would make it different?
any ideas?
other than that I would like to say thank you for putting so much work in making such a lib.impressive.
Have a nice holyday.