We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

3.2 and RegisterMdiChildTypes in BarManager

One of the things I noticed in my upgrade to 3.2 was that I was suddenly getting strange crashes when opening several of my MDI forms. What causes it, is that when a MDI child form is opened, it calls RegisterMdiChildTypes on the BarManager with a copy of the form created via reflection using the default constructor (presumably in previous versions it either wasn''t calling the function, or used the instance of the form that was being added rather than creating a new one via reflection). So a warning to you all - if you don''t have a default constructor for your MDI child form (I didn''t always) or you get a NullReferenceException on a variable in your Dispose or base class constructor code for a variable which you *know* you set in your form - this may be why. Unfortunately the function which allows you to provide an instance of the class to register is private, so there doesn''t appear to be any other way that to have a safe default constructor which can be used to create the class via reflection, and to test all your variables in the constructor/disposal functions before using them. Regards, Sue

1 Reply

AD Administrator Syncfusion Team May 16, 2005 06:19 PM UTC

Hi Sue, Your analysis of the situation looks correct to me. The inclusion of a default constructor is recommended for use with XPMenus regardless of the version of Tools. Regards, Gregory Austin Syncfusion Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon