[Mono-winforms-list] Need help to understand WinForms code

Rolf Bjarne Kvinge rolflists at ya.com
Wed Oct 3 14:19:14 EDT 2007



> -----Original Message-----
> From: mono-winforms-list-bounces at lists.ximian.com [mailto:mono-
> winforms-list-bounces at lists.ximian.com] On Behalf Of Ernesto
> Sent: miércoles, 03 de octubre de 2007 18:33
> To: Mono-winforms-list at lists.ximian.com
> Subject: [Mono-winforms-list] Need help to understand WinForms code
> 
> Hi,
> 
> I'm working on bug #328019
> 
> The problem seems to be that MdiParent is changed during MDI children's
> load event (although it'is set to the same parent again, MdiParent.set
> does it's thing anyway). .NET allows a MdiParent change during the load
> event of a children even to a different parent.
> 
> The simplified problem is:
> 
> MdiParent.set {
>     ...
>     if(value != null) {
>        ...
>         if (IsHandleCreated)
>             RecreateHandle ();
>     }
> }
> 
> Now RecreateHandle() will cause a chain reaction of handle destruction
> (and recreation). The question is, why must the handle be recreated
> (via DestroyHandle by the way) when changing parents?
> 

IIRC it's because .NET recreates the handle when changing parents.

Anyways, if you get a chain reaction it's obviously a bug in our code,
so if possible please file it here: http://bugzilla.novell.com.

Rolf

> Of course, the test app for this bug will pass if you comment
> RecreateHandle ();
> 
> Regards,
> Ernesto
> 
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list



More information about the Mono-winforms-list mailing list