Help populating treeview and delegate ???
Dear all,
I have an VB windows application that colect information form a remote database and then populate the tree view with part of the reords.
As database data can be huge , I have used the Queeue threading process to colect those information. Then when the callback function is called I populate my treeview with teh return object.
As the treeview control is not on the same thread, I have to use the Invoke method.
For that I have first declare a delagate as follow :
Delegate Sub ReelList(ByVal Remote As Object)
Dim CollectReels As ReelList = AddressOf CollectReelHist
Then definition of my function CollectReelHist as :
private sub CollectReelHist (Remote as object)
....blabla
end sub
Then from my call back function of my main form I use :
Dim sParam(0) As Object
sParam(0) = m_objRemoteHist
myTreeView.Invoke(Me.CollectReels, sParam)
The problem I have is that it works only once, as long as my application keeps running. If I stop my application and restart it again after a while the delegate function cannot be called anymore and my application gets status "Not Responding"
I have found out that if I create a new delegate function and paste the same code in it, then it works again for a while.
It sounds like the function pointer gets corrupted after a while.
Do you have any idea ?
When my application restart to I have to use the myDelegate.RemoveAll in order to clean ?
Can a Control invoke different delegates?
thnaks for your help
regards
Serge
Thanks for your help
Regards
CALDERARA Serge
Maillefer S.A
Bookmarks