473,387 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Disposed exception at runtime but not in VS.NET

I'm getting a ObjectDisposedException from my Winform EXE, but not when I run the identical test case in the VS.NET debugger

Our application is a run-of-the-mill two pane (like outlook) app that dynamically creates the right-side user control based on what node you click on the left-side treeview control. Before creating the new user control, the old one is queried to see if any of its data has changed and therefore should be saved

The exception thrown is

System.ObjectDisposedException:
Cannot access a disposed object named "Button"
Object name: "Button"
at System.Windows.Forms.Control.CreateHandle(

And it occurs when a user clicks from the left-side treeview control immediately onto one of the right-side user control's contained controls (e.g. a combo box or button)

I'd be happy to provide any addition detail or code that would help find a solution

Thanks.

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 15 '05 #1
1 1489
I'm assuming the user even has the ability to click the button/control about
to be hidden because the save operation is taking >500ms, perhaps try
Enable=false on the right side before starting the TestForDirty/Save op
--
Eric Newton
C#/ASP Application Developer
er**@cc.ensoft-software.com [remove the first "CC."]

"Scott" <scott_brittain@-NOSPAM-hotmail.com> wrote in message
news:uu**************@TK2MSFTNGP12.phx.gbl...
I'm getting a ObjectDisposedException from my Winform EXE, but not when I run the identical test case in the VS.NET debugger.
Our application is a run-of-the-mill two pane (like outlook) app that dynamically creates the right-side user control based on what node you click
on the left-side treeview control. Before creating the new user control,
the old one is queried to see if any of its data has changed and therefore
should be saved.
The exception thrown is:

System.ObjectDisposedException:
Cannot access a disposed object named "Button".
Object name: "Button".
at System.Windows.Forms.Control.CreateHandle()

And it occurs when a user clicks from the left-side treeview control immediately onto one of the right-side user control's contained controls
(e.g. a combo box or button).
I'd be happy to provide any addition detail or code that would help find a solution.
Thanks.

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ryan Park | last post by:
Hi, //SITUATION I got a panel control that hold a certain position on a form. Every controls or UIs are on this panel. At certain situation, I called dispose() method of this panel control...
2
by: michael Schindler | last post by:
I get an error message since i installed visual studio 2003 :-( Please help me why i get this message? An unhandled exception of type 'System.ObjectDisposedException' occurred in...
0
by: Scott | last post by:
I'm getting a ObjectDisposedException from my Winform EXE, but not when I run the identical test case in the VS.NET debugger. Our application is a run-of-the-mill two pane (like outlook) app that...
9
by: David Sworder | last post by:
Hi, I have a form that displays data (is that vague enough for you?). The data comes in on a thread-pool thread. Since the thread pool thread is not the same as the UI thread, the callback...
5
by: theinvisibleGhost | last post by:
I'm having a problem that occurs at random in my app. I get an exception "Cannot Access a disposed object" In MSCorLib when calling boolean Change (int32, int32) Stack trace reveals...
0
by: =?Utf-8?B?aGVyYmVydA==?= | last post by:
I read from a serialport using a worker thread. Because the worker thread t does not loop often, I cannot wait to terminate the worker thread using a boolean in the While condition. So I have a...
31
by: Zytan | last post by:
There is no IsDisposed() method. I could just access it, and catch ObjectDisposedException, but that seems ugly. Zytan
1
by: Amit Dedhia | last post by:
Hi I am having problem working with Timers in C++/CLI (the .NET version of C++) I have an application which has several forms with pictureBox controls on it. There is a background timer...
5
by: aine_canby | last post by:
Hi, The problem is that the line - this.Invoke(new MyDelegate(Function), args); // this = MainForm is being called after the line - terminatePopulate = true; therefore I get an exception...
4
JustRun
by: JustRun | last post by:
Hi All, I'm developing a windows desktop solution using VC# , I deal with my database using Dataset. My Problem that i'm trying to call a Form to display a confirmation message after every...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.