RE: Help Thread pooling ???

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I just try your suggestion use the invoke at each node but it freeze
immediatly for ever.

It freeze as soon as the Invoke line start to be executed
I am stuck indeed out of idea.


"Jakob Christensen" wrote:

> The necessary call to Invoke causes the update of the treeview to execute on
> the thread of your form. This means that the UI will be unresponsive while
> the treeview is being populated because the main thread is busy.
>
> If you want the UI to be more responsive you might want to try changing the
> code so that Invoke is called once for each item instead of once for all
> items. This will give the main thread a little extra time to update the UI
> inbetween the calls to Invoke. You may have to add some code to handle the
> case where the user closes the form while the tree is being populated.
>
> HTH, Jakob.
> --
> http://www.dotninjas.dk
> http://www.powerbytes.dk
>
>
> "serge calderara" wrote:
>
> > 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
.



Relevant Pages

  • RE: Help Thread pooling ???
    ... responding" for ever even if my caollected data is a simple and unique row ... > The necessary call to Invoke causes the update of the treeview to execute on ... >> 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 ...
    (microsoft.public.dotnet.general)
  • Re: unix guy needs win32 API help
    ... is trying to *invoke* an existing right-click option on a given file. ... execute a program or calls a DLL in the fashion specified by file extension. ... the program associated with it by selecting it and clicking "Properties". ...
    (comp.lang.perl.misc)
  • Problems with first gem using Rake/Hoe
    ... I'm trying to package my first gem using Hoe and am having ... difficulties with Rake on a Windows XP system. ... execute the task outside of Rake. ... ** Invoke package ...
    (comp.lang.ruby)
  • Re: RubyCocoa and libxml-ruby-0.3.6
    ... sudo make install ... rm -r html ... ** Invoke default ... ** Execute clobber_doc ...
    (comp.lang.ruby)
  • RE: Help Thread pooling ???
    ... The necessary call to Invoke causes the update of the treeview to execute on ... > This function is also populating a treeview control whne collected data gets ...
    (microsoft.public.dotnet.general)