Hi -
i''m trying to use the recommended approach to disposing of the docking manager to deal with some application crashing we are experiencing. However, i am getting an "object ref not set" error on the call to "this.dockingManager.Controls". The dockingmanager is not null, and i can call other methods to get info about it''s docked controls (GetAutoHideMode, ActiveControl, etc.). Any idea what could cause this?
Error stack trace:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="Syncfusion.Tools.Windows"
StackTrace:
at Syncfusion.Windows.Forms.Tools.DockingManager.GetControlsSequence(DockControllerBase controller, ArrayList controls)
at Syncfusion.Windows.Forms.Tools.DockingManager.get_Controls()
Dispose Code:
IEnumerator ienum=this.dockingManager.Controls;
ArrayList ctrls=new ArrayList();
while(ienum.MoveNext())
ctrls.Add(ienum.Current);
foreach(Control ctrl in ctrls)
{
this.dockingManager.SetEnableDocking(ctrl,false);
ctrl.Dispose();
}
this.dockingManager.Dispose();
JL
Julie Levy
July 12, 2006 10:06 PM UTC
I forgot to mention that i''m using the latest version 4.2.0.37 and Visual Studio 2005 and my operating system is XP.
MJ
Mano J
Syncfusion Team
July 13, 2006 10:57 AM UTC
Hi Julie,
We regret for the inconvenience caused. This is a known issue with SetEnableDocking method in v.4.2.0.37 and it has been taken care of internally in our source.
If you like to receive a Service pack containing this fix, please create a Direct-Trac incident with this forum link in the subject line.
Please let me know if you have any questions. Thanks for using Essential Tools.
Regards,
Mano
JL
Julie Levy
July 25, 2006 09:02 PM UTC
Hi -
Thanks for your response.
I will log an incident, but just wanted some clarification. The error i got was on this.dockingManager.Controls, not the call to the SetEnableDocking method. Are we talking about the same issue?
Thanks,
Julie
JK
Joy K George
Syncfusion Team
July 26, 2006 08:11 PM UTC
Hi Julie,
Could you please send us the full stack trace?
So that we could compare with the stack trace which produced here.
Regards,
Joy
JL
Julie Levy
July 27, 2006 06:58 PM UTC
The stack trace i posted in the first post is the most information i have.
The exception happens at:
ienum = dockingManager.Controls;
JL
Julie Levy
July 27, 2006 11:56 PM UTC
I do have one more bit of info, not sure if it''s relevant.
This code is called in the Dispose method of a class which inherits from UserControl. The dockingmanager is on a user control, not a form.
MU
Murugan
Syncfusion Team
August 2, 2006 01:13 AM UTC
Hi Julie,
We regret for the inconvenience caused.
I was able to reproduce the issue here with 4.2.0.37.But our latest source is free from this issue. We are going to release our next patch on thursday.So could you please create a DirectTrac incident to obtain the patch release?
Regards,
Murugan P.S
JL
Julie Levy
August 9, 2006 08:39 PM UTC
Hi -
I got the patch, but still get the same exception, same call stack. It can happen if the dispose is called more than once. I wish it returned null instead of throwing the exception. I''ve re-written some code to avoid this, but wanted to let you know it''s still there.
JK
Joy K George
Syncfusion Team
August 10, 2006 11:02 PM UTC
Hi Julie,
We were able to reproduce the exception when we tried to call the dispose more than once.
You could resolve this issue by handling the exception using try catch method.
There is no need to excute dispose operation more than once.So you could eliminate the issue by handling exception since it will dispose the controls at the first time itself.
Regards,
Joy
JL
Julie Levy
August 11, 2006 06:02 PM UTC
Thanks, i''m already doing this. It just seemed wrong that DockingManager.Controls threw an exception when i could call the other methods on DockingManager to get information about controls (GetVisibility, GetAutoHideMode, etc.).
JK
Joy K George
Syncfusion Team
August 14, 2006 04:07 AM UTC
Hi Julie,
Yes ,You will get exceptions if the control is not docked at the time of calling such methods.For example if you call the method IsSameTabbedGroup() with arguements which are not in tabbed style you will get an exception.
You could handle that by using the usual method (try.. catch)which you are following now.
Please let us know , if you have any other queries.
Regards,
Joy