WindowsForm freezes on second launch

  • Thread starter Thread starter bigreddog
  • Start date Start date
B

bigreddog

I have a WindowsForm application that I developed on my XP workstation.
It is a nulti-threaded socket application that sends and receives
messages. On my workstation I can close and restart the application
normally with no ill effects.

Now when I put the application on a Windows 2000 Server it runs
perfectly fine the first time around. However, when I close the
application and try to restart it the second time it won't show the UI,
minimizes itself to the taskbar and Task Manager shows it as Not
Responding.

Is this a Framework issue? XP vs 2000? Any ideas where to start?
Thanks
Bigreddog
 
Maybe the socket is not closed properly when closing the application so the
next time it starts the socket is still in the background and blocks itself.
 
Update - I tried the same application on my co-worker's XP workstation
and it behaved exactly like it did on Win2K Server; It started up but
the UI never appeared and the Task Manager stated "Not Responding." So
there has to be a configuration on my workstation that is missing on
others. Could this be Framework SP 1?

Any ideas?
 
I have a WindowsForm application that I developed on my XP workstation.
It is a nulti-threaded socket application that sends and receives
messages. On my workstation I can close and restart the application
normally with no ill effects.

Now when I put the application on a Windows 2000 Server it runs
perfectly fine the first time around. However, when I close the
application and try to restart it the second time it won't show the UI,
minimizes itself to the taskbar and Task Manager shows it as Not
Responding.

The first thing i would do, as it is a multi-threaded application, is to
make sure that, each time you are accessing a UI element, you are doing it
from the UI thread. You may simply have forgot an Invoke somewhere where
you were accessing a UI control from a worker thread.

Also, check your code to make sure that you never swallow exceptions (ie
catch an exception and hide it by doing nothing) and that you never catch
all exceptions with a catch(Exception ex) statement instead of catching a
particular exception type. Doing this kind of things may hide the reason of
the problem.
 
Elp,

Thanks for your feedback. I have a couple places in my code where I
catch an Exception and do nothing. I also do a couple of Try Catch
statements where there is no specific Exception caught.

What should I be doing differently with the Exceptions? Send them to
the Event Viewer?
 
Back
Top