G
Guest
Dear all,
I have a function that I need to run in a thread due to the fact that it can
takes long time to execute according to the amount of data to collect.
This function is also populating a treeview control whne collected data gets
finished.
In order to achieve this I have used the following code :
System.Threading.ThreadPool.QueueUserWorkItem(New
System.Threading.WaitCallback(AddressOf GetListOfReelsFromRemoteDB))
Then my function definition is as follow :
===>>
private sub GetListOfReelsFromRemoteDB
m_objRemoteHist = New Remote(m_sRemoteDbPath)
m_objRemoteHist.Read()
Dim sParam(0) As Object
sParam(0) = m_objRemoteHist
tLogView.Invoke(AddReels, sParam)
Me.Cursor = Cursors.Default
end sub
<<===
The Read routine, collect data froma remote database
When Read return, it populates a tree view control with a delagate object by
using the Invoke.
Problem I have is that when tLogView.Invoke(AddReels,sparam) execute, it
frees my whole application and gets "no responding status". I guess there
shuld be something wrong with the thread queue process but do not know why
and how to solve it
Does anyone could help ?
regards
serge
I have a function that I need to run in a thread due to the fact that it can
takes long time to execute according to the amount of data to collect.
This function is also populating a treeview control whne collected data gets
finished.
In order to achieve this I have used the following code :
System.Threading.ThreadPool.QueueUserWorkItem(New
System.Threading.WaitCallback(AddressOf GetListOfReelsFromRemoteDB))
Then my function definition is as follow :
===>>
private sub GetListOfReelsFromRemoteDB
m_objRemoteHist = New Remote(m_sRemoteDbPath)
m_objRemoteHist.Read()
Dim sParam(0) As Object
sParam(0) = m_objRemoteHist
tLogView.Invoke(AddReels, sParam)
Me.Cursor = Cursors.Default
end sub
<<===
The Read routine, collect data froma remote database
When Read return, it populates a tree view control with a delagate object by
using the Invoke.
Problem I have is that when tLogView.Invoke(AddReels,sparam) execute, it
frees my whole application and gets "no responding status". I guess there
shuld be something wrong with the thread queue process but do not know why
and how to solve it
Does anyone could help ?
regards
serge