I have a problem which users have reported of an error that appears when loading a form with a docking manager and several docking windows (2 docked + 1 floating). Upon loading the form a dialog appears with LoadDockState failed. The dialog output is attached.
This error occurs seemingly sporadically and so far I have failed to reproduce it. Once the problem appears once, it appears every time the form is loaded.
The only way I have found to clear the problem is to clear the Isolated Storage area.
Has anyone come across this problem, or may know the cause - even if I can reliably reproduce it that would be a bonus...!
This is not something that we have come across. If you can isolate the conditions and are able to reproduce the problem, please send over a sample and we will look into it. One thing that you could try though would be turn on Exceptions within the VS.NET IDE and then run your app a few times. That should help identify the placement of the null instance. Are you performing any custom initialization of the docking layout inside your application?
SSStuart SmithMay 23, 2003 05:11 AM
I have managed to fix this now.
Basically I had some code in the DockVisibilityChanged event that created a Memento of the visibility of each docked control
- this was then used by Undo / Redo functionality.
I was filtering the events by an 'isLoading' flag, however if the DockState was anything other than the default the event was being triggered by the Form Layout event. I added a 'isLayingOut' flag, and it seemed to solve the problem.
I'm not entirely sure why, but the reference to the docking manager stored in the Memento object was screwing up the LoadDockState. The Memento works fine otherwise.
Thanks for your time,