ChildFormDialog error


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have a ChildFormDialog control on a form, and have set up the ChildForm and BO Translations for it.  The child form is coming from a dll and is an inherited form.  In my code I call ChildFormBank.ShowDialog() and get the attached error message every time.

I have included the stack trace for more info.


11/2/2006 9:35:32 AM
Source: mscorlib
Message: Value cannot be null.
Parameter name: type
Stack:    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.CreateForm(Object[] Arguments)
   at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.ShowDialog(Object[] Arguments)
   at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.ShowDialog()
   at BBS.GUI.frmClientInfo.MaintBankRel_AfterButtonClick() in C:\FactorSoftV3\GUI\ClientInfo\frmClientInfo.vb:line 205
   at BBS.GUI.BaseControls.MaintStrip.button_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


 

Replies
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
OK, I sort of figured it out.  Not sure what this means and pretty sure it's not supposed to work this way.  I have a local form which I set as the ChildForm, and this works fine...no problems.  This works without creating an instance of the local form.  When I try to set the ChildForm to a form coming from a referenced DLL it gives me the error.  However, if I create an instance of the form (with any name) it works fine.  So basically if it's a form from the same project no instance is needed, but if it's coming from a referenced dll then you must create an instance first.

This code works for forms in same project:

ChildFormDialog1.ShowDialog()

This code works for forms from dlls where ChildFormDialog1 has ChildForm=frmChildForm:

Dim ChildFormDLL as New frmChildForm
ChildFormDialog1.ShowDialog

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Actually, you can use a referenced form from a DLL.  But the problem may be that the full name (i.e. YourNameSpace.YourForm) may not be valid through the reference that is being specified.  You may need to load the assembly.  For example, open your designer file and go to the ChildForm property in the designer file.  You will see the name of the form like something I mentioned above.  See if your activator.CreateInstance works with the full name rather than the type:

Activator.CreateInstance("YourNameSpace.YourFormName")

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Andria Jensen - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Andria Jensen - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Andria Jensen - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Andria Jensen - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Chan - 18 Years Ago
                     What sort of error do you get from the second call to...
StrataFrame Team - 18 Years Ago
                         Hi,
I hit error

Constructor on type...
Chan - 18 Years Ago
                             Aha, in the code that you posted, you're expecting one parameter that...
StrataFrame Team - 18 Years Ago
                                 If you didn't want to pass all of your parameters as an object[], then...
StrataFrame Team - 18 Years Ago
                                     [quote][b]Ben Chase (08/28/2007)[/b][hr]If you didn't want to pass all...
Chan - 18 Years Ago
                                         Yep, the ChildFormDialog is designed to work like that. If your form...
StrataFrame Team - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search