Re: Problem (dispose?) MDI forms

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



aah 3rd party control. You could post on their site or ask them see if there
are known issues that you should look for. You could use the debug
environment to see if all objects are cleaned up as promised.!

VJ

"SealedClassSingleton" <SealedClassSingleton@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote in message news:D4FAA0B5-8D96-4AAC-9B80-144C06D06D8D@xxxxxxxxxxxxxxxx
I don't call the close myselft. It's done by the tabbedMDI interface from
Janus (www.janusys.com). It looks like a tab where eveyry form is
represented
on a seperate tabpage.

I don't think it's related to them, because I use these controls in a
number
of projects and it don't have similar problems. It looks like in this case
the notification to the mdiparent gets lost...


"VJ" wrote:

Very tricky. I truly agree. Have developed MDI apps for last few years as
programmer. I don't like solutions like these, but sometimes after close
you can just set the object to null.

One thing tho'.. if you tabbed MDI, how is a child Form in a tab?, and
you
do frm.Close().. and I am assuming you remove the Tab. Just curious on
those
steps..!

VJ

"SealedClassSingleton" <Eagle@xxxxxxxxxxxxxxxx> wrote in message
news:FDADA37E-82F9-44D8-B3BB-9A28CCF86761@xxxxxxxxxxxxxxxx
I agree that closing a form doens't mean that the form is immediate
released,
but the problem is a little more subtile: I'm sure that the form is
disposed
(I put some code in the destructor), but it remains accessible through
the
mdilist and in the midichildren property. As far as I know, no
addtional
child are created inside the form (I additionaly even check if all
controls
are removed...)

I agree, that it could take a while to be GCed (depending on memory
consumption / load and other things) but once a form is closed it
shouldn't
be accessible anymore (In my situation is even worde bacause I'm using
a
tabbed mdi interface and the users stills sees the "closed" window in
the
MDI
tab. Clicking on it generates the exception)...

"VJ" wrote:

Sure.. Close does not mean the object is immediately available to be
garbage
collected and disposed. There is still other objects created by child
Form2
in memory, as long as all of it are not cleared Form2 will exist. Now
these
are not limited to Child form controls, they can be threads or any
other
objects created when Form2 i.e. child was in memory and working...

HTH
VJ
"SealedClassSingleton" <Eagle@xxxxxxxxxxxxxxxx> wrote in message
news:3238DC52-45DD-4B33-93F0-DA6A19AAAEA0@xxxxxxxxxxxxxxxx
Hi,

I've a very weird error in an MDI application. From time to time,
when
closing a child form, the form is closed correctly (put some
writelines
on
different places: form_closing / form_closed / dispose) but is not
removed
from the MDIparent.

When I iterate over all child forms I can close the form a second
time
(?)
even all controls are already disposed.

When clicking on the "closed" form in the MDI list, I get an
ObjectDisposed
Exception.

A first chance exception of type 'System.ObjectDisposedException'
occurred
in System.Windows.Forms.dll
System.ObjectDisposedException: Cannot access a disposed object.

Anyone who had similar problems ? Suggestions ?








.



Relevant Pages

  • Re: Problem (dispose?) MDI forms
    ... It looks like a tab where eveyry form is ... I don't think it's related to them, because I use these controls in a ... child are created inside the form (I additionaly even check if all ... tabbed mdi interface and the users stills sees the "closed" window in ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: How come my forms wont resize...
    ... any controls on your child form, then the form behaves as expected. ... I tested that with the Minimizebox property on the parent form. ... This attribute tells Visual Studio Designer that if the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Receive multiple events from child controls
    ... >> the number of child controls created. ... >parent, while the user is interacting with the form, ... >If you're getting spurious OnFocus events as you add each ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • DataBinding ... (long)
    ... property TableName of xxx passed to a child forms constructor ... Every time the ChildForm is showing I have a probem ... to move between its controls after changing Text of TextBox0. ... It works ok also if Child form is not ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Resizing MDI Child forms
    ... > MDI Parent form (used to house command buttons to change the MDI ... If you don't have multiple child forms ... > Each form - and associated controls - will need to resize differently. ...
    (microsoft.public.vb.general.discussion)