My application uses esignal to request a stream of real time quotes for multiple stocks. The data retrieve works fine. The problem is when the application exits, it raises COM exception. The error message is:
System.Runtime.InteropServices.COMException (0x80010100): System call failed.
at IESignal.HooksClass.ReleaseSymbol(String sSymbol)
at Solution.Project.ReleaseSymbol()
at Solution.Project.Dispose(Boolean disposing)
…
Here is my question.
1. I realize that user manual mentions when the user changes to a different symbol, the ReleaseSymbol function should be used. Since real time quotes for multiple symbols is a must in this case, what is a good way to release symbols?
2. Is there any function to check if the data manager still has that symbol before calling ReleaseSymbol? What if the symbol is not released?
Code Snippet:
'ht.keys hold all symbols for real-time quotes
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
ReleaseSymbol()
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private Sub SendRequest(ByVal ht As Hashtable)
Dim al As ArrayList = New ArrayList(ht.Keys)
For Each symbol As String In al
esignal.RequestSymbol(symbol, True)
Next
MsgBox("wait 2 seconds")
End Sub
Private Sub ReleaseSymbol()
If Not ht Is Nothing Then
Dim al As ArrayList = New ArrayList(ht.Keys)
For Each symbol As String In al
esignal.ReleaseSymbol(symbol)
Next
End If
End Sub
System.Runtime.InteropServices.COMException (0x80010100): System call failed.
at IESignal.HooksClass.ReleaseSymbol(String sSymbol)
at Solution.Project.ReleaseSymbol()
at Solution.Project.Dispose(Boolean disposing)
…
Here is my question.
1. I realize that user manual mentions when the user changes to a different symbol, the ReleaseSymbol function should be used. Since real time quotes for multiple symbols is a must in this case, what is a good way to release symbols?
2. Is there any function to check if the data manager still has that symbol before calling ReleaseSymbol? What if the symbol is not released?
Code Snippet:
'ht.keys hold all symbols for real-time quotes
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
ReleaseSymbol()
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private Sub SendRequest(ByVal ht As Hashtable)
Dim al As ArrayList = New ArrayList(ht.Keys)
For Each symbol As String In al
esignal.RequestSymbol(symbol, True)
Next
MsgBox("wait 2 seconds")
End Sub
Private Sub ReleaseSymbol()
If Not ht Is Nothing Then
Dim al As ArrayList = New ArrayList(ht.Keys)
For Each symbol As String In al
esignal.ReleaseSymbol(symbol)
Next
End If
End Sub