Windows App Freezing

J

John Riddle

I have a muti-threaded windows app that creates child forms in a separate
thread which then invoke a delegate on the MDI parent form. I have put all
time-consuming tasks on separate background workers like running stored proc,
poppulating data grid, etc. I am running VB.Net 2005 on Windows 2000 SP4 and
on XP SP2. After a period of inactivity in the app (15-30 minutes), it
freezes. The task manager says its running but I cannot switch to it. I tried
using the DoEvents method on a timer but that had very strange results - the
app was responsive but all the functionailty errored out. I read up on message
pumps and STA model. Even though its should be an MTA, when I try and do
application.run - it forces me to create the MDIFrm as STA or a Treeview
control on it will not register drag-drop events. I am not using
application.run but have set the MDIForm as startp form (and not set it to run
as single instance so it should be STA). I am not using any COM but am using
Infragistics 3rd party grid control and dock manager. Both are .Net components
and don't require registering. The MDIForm as a treeview, dockmanger and a
tablelayout panel prior to opening child forms. Any ideas why this freezing is
occurring? It was much more frequent (even if there was activity) on XP with
SP1 but with SP2, it was much less. Please advise.

Thanks
Anita
 
M

Michael Moreno

Hi,

I have had a similar problem and found out that I forgot to use the
standard:

if (InvokeRequired)
BeginInvoke...

in a few places in the UI methods.

hope this helps.

regards,
MM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top