Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

WindowsForm freezes on second launch

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bigreddog - 18 Feb 2005 13:19 GMT
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
cody - 18 Feb 2005 14:08 GMT
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.

> I have a WindowsForm application that I developed on my XP workstation.
> It is a nulti-threaded socket application that sends and receives
[quoted text clipped - 10 lines]
> Thanks
> Bigreddog
bigreddog - 18 Feb 2005 14:49 GMT
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?

> 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.
[quoted text clipped - 13 lines]
> > Thanks
> > Bigreddog
Elp - 18 Feb 2005 19:56 GMT
> I have a WindowsForm application that I developed on my XP workstation.
> It is a nulti-threaded socket application that sends and receives
[quoted text clipped - 6 lines]
> 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.
bigreddog - 21 Feb 2005 13:52 GMT
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?

> > I have a WindowsForm application that I developed on my XP workstation.
> > It is a nulti-threaded socket application that sends and receives
[quoted text clipped - 17 lines]
> particular exception type. Doing this kind of things may hide the reason of
> the problem.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.