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 Controls / February 2005

Tip: Looking for answers? Try searching our database.

System.ObjectDisposedException

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maqsood Ahmed - 21 Feb 2005 09:00 GMT
Hello,
We have experiencing a problem with our MDI application that
'System.ObjectDisposedException' occurs while starting the application.
Following is the stack trace for the exception.
Note that the application first shows a Login form as a child form.

System.ObjectDisposedException: Cannot access a disposed object named
"Label".
Object name: "Label".
  at System.Windows.Forms.Control.CreateHandle()
  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  at System.Windows.Forms.Control.CreateControl()
  at System.Windows.Forms.Control.WmShowWindow(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  at System.Windows.Forms.ContainerControl.WndProc(Message& m)
  at System.Windows.Forms.Form.WmShowWindow(Message& m)
  at System.Windows.Forms.Form.WndProc(Message& m)
  at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

It is important to note that it doesn't happen regularly, it just
appears suddenly (1 out of 200 times) but still it is irritating for the
end user. Any suggestions/workarounds?
Cheers.

Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
joeycalisay - 21 Feb 2005 10:14 GMT
someone is accessing the disposed Label instance.  As a safety, you should
have a check if a control that you are using is disposed using the
IsDisposed property of Control.

For the meantime, to get the line that really caused the problem, try to
catch the exception the moment it was thrown.  For the procedure, just in
case you don't know, try this link:

http://groups-beta.google.com/group/microsoft.public.dotnet.framework.windowsfor
ms/browse_thread/thread/3654e67e17cfefcf/f760aad7837d9cef?_done=/group/microsoft
.public.dotnet.framework.windowsforms/?&_doneTitle=Back+to+topics&_doneT
itle=Back&&d#f7


Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> Hello,
>  We have experiencing a problem with our MDI application that
[quoted text clipped - 31 lines]
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

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.