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
close icon

Problem with ChildBarFrameManager in MDI-Application

I've a problem with ChildBarFrameManager. I'm using the windows manager class from the featured demo project. It works successfull in my application. Today I open the project and the programm isn't longer running (compiling ok). During the MDI-child creation process the following run time error occurs: System.ArgumentException: Cannot find a ChildFrameBarManager associated with the form type: Genesis.HtmlEditorForm at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.RegisterMdiChildTypes(Type[] formTypes) at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.MdiChildAdded(Object sender, ControlEventArgs e) at System.Windows.Forms.ControlEventHandler.Invoke(Object sender, ControlEventArgs e) at System.Windows.Forms.Control.OnControlAdded(ControlEventArgs e) at System.Windows.Forms.ControlCollection.Add(Control value) at System.Windows.Forms.ControlCollection.Add(Control value) at System.Windows.Forms.Control.set_ParentInternal(Control value) at System.Windows.Forms.Form.set_ParentInternal(Control value) at System.Windows.Forms.Form.set_MdiParentInternal(Form value) at System.Windows.Forms.Form.set_MdiParent(Form value) at Genesis.WindowManager.AddDocument(HtmlEditorForm newForm) in d:\dokumente und einstellungen\joerg\eigene dateien\visual studio-projekte\worldsoftgenesisii\windowmanager.cs:line 211 at Genesis.WindowManager.AddDocumentFromFileName(String fileName) in d:\dokumente und einstellungen\joerg\eigene dateien\visual studio-projekte\worldsoftgenesisii\windowmanager.cs:line 204 at Genesis.WindowManager.OpenFile() in d:\dokumente und einstellungen\joerg\eigene dateien\visual studio-projekte\worldsoftgenesisii\windowmanager.cs:line 110 at Genesis.WindowManager.openBarItem_Click(Object sender, EventArgs e) in d:\dokumente und einstellungen\joerg\eigene dateien\visual studio-projekte\worldsoftgenesisii\windowmanager.cs:line 95 at Syncfusion.Windows.Forms.Tools.XPMenus.BarItem.OnItemClicked(EventArgs args) at Syncfusion.Windows.Forms.Tools.XPMenus.BarItem.PerformClick() at Syncfusion.Windows.Forms.Tools.XPMenus.BarRenderer.OnMouseUp(MouseEventArgs e) at Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) == The step before the error are: // create new child form (successful) HtmlEditorForm childForm = new HtmlEditorForm(fileName); // let the new form attach to the mdi parent newForm.MdiParent = this.EditorMainForm; This statement forces the error. I've tried to debug. childForm does contain a ChildBarFrameManager. The designer shows the bar items. There are some ActiveX controls in the form, but this part of the application works in the past days with and without childBarFrameManager. == Questions: If the form has a childBarFrameManager, created with the designer and properly working in the past, what could happen here? How to debug the process of attaching a MDI child? Thanks for any idea on this subject, Joerg Krause Berlin, Germany

4 Replies

JK Joerg Krause March 4, 2003 08:51 PM UTC

Some additional informations: If I delete the previous used childFrameBarManager (loosing all associated Bars), the error disappears. If a new childFrameBarManager was added from the toolbar, the error reoccurs. It doesn't matter if bars associated or not. Joerg


RP Ramesh Praveen Syncfusion Team March 5, 2003 12:35 PM UTC

Joerg, This probably happens because your child form doesn't have a default constructor. Like we state in our User's Guide, all child forms (using the ChildFrameBarManager) should include a default constructor calling the InitializeComponent method (where the bar manager gets initialized). This is necessary because our framework will want to create a dummy instance of each registered child form type. So, provide a default constructor like this: public HtmlEditorForm() { InitializeComponent(); } and it should work fine. Regards, Praveen Ramesh


JK Joerg Krause March 5, 2003 09:27 PM UTC

Thank you for the response. I've read about the constructor in the help files. So I had a constructor but without InitializeComponent() in it. What it really needs was the call to InitializeComponent(); which I have removed. Maybe the info is helpful for anybody. > > public HtmlEditorForm() > { > InitializeComponent(); > } > > and it should work fine. > > Regards, > Praveen Ramesh > Joerg


AD Administrator Syncfusion Team March 11, 2003 06:56 PM UTC

Thanks for the update.

Loader.
Live Chat Icon For mobile
Up arrow icon