我的项目包含对SetSession的调用ManyTime SomeTime它的崩溃。请任何人都可以帮助我。
这里的部分代码:
public Function SetSession(sSessionName As String) As Boolean
Dim intCount As Integer
'Call Refresh
SetSession = False
Dim oSessions As ExtaSessions = Nothing
Dim oSession As ExtraSession = Nothing
moSession = Nothing
oSessions=TryCast(moSystem.Sessions,ExtraSessions)
moSession=TryCast(oSessions.Item(sSessionName),ExtraSession)'=> Crashing in this line
If Information.Err().Number <> 0 Then
For intcount = 1 To oSessions.Count
oSession = TryCast(oSessions.Item(intCount), ExtraSession)
if oSession.Name = sSessionName then
moSession = oSession
Exit for
End if
NExt
End if
if moSession is Nothing then
Exit Function End If
SetSession = True
End Function
以下附件PrintScreen for Exception