By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,899 Members | 1,470 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,899 IT Pros & Developers. It's quick & easy.

Help on populating a treeView and delegate ???

P: n/a
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
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.