﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » ChildFormDialog error</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 28 May 2026 14:27:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost11213.aspx</link><description>Yep, the ChildFormDialog is designed to work like that.&amp;nbsp; If your form is like this:&lt;/P&gt;&lt;P&gt;public class Form1 : System.Windows.Forms.Form&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Form1(string param1, string param2, string param3) { }&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;Then you're call to childFormDialog.ShowDialog() will look like this:&lt;/P&gt;&lt;P&gt;childFormDialog.ShowDialog("param1", "param2", "param3");&lt;/P&gt;&lt;P&gt;The signature of the method is like this:&lt;/P&gt;&lt;P&gt;public DialogResult ShowDialog(params object[] parameters) {}&lt;/P&gt;&lt;P&gt;The keyword being the "params" at the beginning.&amp;nbsp; It means that you can add as many parameters as you want and separate them with commas and the compiler will pass them all as one big object array.&amp;nbsp; It's smart like that :)</description><pubDate>Wed, 29 Aug 2007 10:35:49 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost4078.aspx</link><description>I have a ChildFormDialog control on a form, and have set up the ChildForm and BO Translations for it.&amp;nbsp; The child form is coming from a dll and is an inherited form.&amp;nbsp; In my code I call ChildFormBank.ShowDialog() and get the&amp;nbsp;attached error message every time.&lt;/P&gt;&lt;P&gt;I have included the stack trace for more info.&lt;/P&gt;&lt;P&gt;&lt;BR&gt;11/2/2006 9:35:32 AM&lt;BR&gt;Source: mscorlib&lt;BR&gt;Message: Value cannot be null.&lt;BR&gt;Parameter name: type&lt;BR&gt;Stack:&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Activator.CreateInstance(Type type, Object[] args)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.CreateForm(Object[] Arguments)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.ShowDialog(Object[] Arguments)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.ShowDialog()&lt;BR&gt;&amp;nbsp;&amp;nbsp; at BBS.GUI.frmClientInfo.MaintBankRel_AfterButtonClick() in C:\FactorSoftV3\GUI\ClientInfo\frmClientInfo.vb:line 205&lt;BR&gt;&amp;nbsp;&amp;nbsp; at BBS.GUI.BaseControls.MaintStrip.button_Click(Object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.OnClick(EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at DevExpress.Utils.Controls.ControlBase.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)&lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;/P&gt;&lt;P&gt;&lt;BR&gt;&amp;nbsp;</description><pubDate>Wed, 29 Aug 2007 10:35:49 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost11193.aspx</link><description>[quote][b]Ben Chase (08/28/2007)[/b][hr]If you didn't want to pass all of your parameters as an object[], [/quote]&lt;br&gt;
&lt;br&gt;
Hi,&lt;br&gt;
Thank you tip.&lt;br&gt;
I will try it out later.&lt;br&gt;
&lt;br&gt;
[quote]then you'll want to change your constructor so that it does not expect an object, but just 3 regular parameters. Then, you can remove the outer object from the CreateInstance() call.[/quote]&lt;br&gt;
&lt;br&gt;
I don't think ChildFormDialog support this, doesn it?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Tue, 28 Aug 2007 20:27:14 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost11144.aspx</link><description>If you didn't want to pass all of your parameters as an object[], then you'll want to change your constructor so that it does not expect an object, but just 3 regular parameters.&amp;nbsp; Then, you can remove the outer object from the CreateInstance() call.</description><pubDate>Tue, 28 Aug 2007 08:49:03 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost11143.aspx</link><description>Aha, in the code that you posted, you're expecting one parameter that it an object[].&amp;nbsp; When you call the Activator.CreateInstance, it's excpecting you to pass all of the parameters in an object[], so, you have to put your object[] into the object[] that the CreateInstance method is excpecting.&amp;nbsp; Like this:&lt;/P&gt;&lt;P&gt;loForm = (PaymentForm) Activator.CreateInstance(Type.GetType("JK.Payment.UI.Windows.Forms.PaymentForm"),&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new object[] { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new object[] { JK.Payment.Enums.TxnType.Sale, salesBO.SaleNo, salesBO.Total } } );&lt;/P&gt;&lt;P&gt;The object[] that the CreateInstance is expecting is an array of all of the parameters, so the one that you create only needs to contain one item.&amp;nbsp; But, since that one item is itself an array of object, you'll have to put your parameter object[] inside another object[] to pass to the CreateInstance() method.</description><pubDate>Tue, 28 Aug 2007 08:47:50 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost11098.aspx</link><description>Hi,&lt;br&gt;
I hit error &lt;br&gt;
&lt;br&gt;
Constructor on type 'JK.Payment.UI.Windows.Forms.PaymentForm' not found.&lt;br&gt;
&lt;br&gt;
However, as the code I posted, it works if I use the code below&lt;br&gt;
&lt;br&gt;
//Workign OK&lt;br&gt;
&lt;br&gt;
            Payment.UI.Windows.Forms.PaymentForm loForm = new PaymentForm(new object[] &lt;br&gt;
&lt;br&gt;
                { JK.Payment.Enums.TxnType.Sale, salesBO.SaleNo, salesBO.Total });&lt;br&gt;</description><pubDate>Mon, 27 Aug 2007 09:27:15 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost11096.aspx</link><description>What sort of error do you get from the second call to Activator.CreateInstance (the one where you pass the starting parameters)?&amp;nbsp; Is is a MissingMethodException?&amp;nbsp; Or a TypeLoadException?&amp;nbsp; Or something else?</description><pubDate>Mon, 27 Aug 2007 09:19:23 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost11078.aspx</link><description>Hi,&lt;br&gt;
I am facing the same problem.&lt;br&gt;
&lt;br&gt;
I tried the code below.&lt;br&gt;
[codesnippet]&lt;br&gt;
&lt;br&gt;
            //Workign OK&lt;br&gt;
            Payment.UI.Windows.Forms.PaymentForm loForm = new PaymentForm(new object[] &lt;br&gt;
                { JK.Payment.Enums.TxnType.Sale, salesBO.SaleNo, salesBO.Total });&lt;br&gt;
&lt;br&gt;
            loForm.ShowDialog();&lt;br&gt;
&lt;br&gt;
            loForm.Dispose();&lt;br&gt;
&lt;br&gt;
            //Workign OK&lt;br&gt;
            loForm = (PaymentForm)Activator.CreateInstance(Type.GetType("JK.Payment.UI.Windows.Forms.PaymentForm"));&lt;br&gt;
&lt;br&gt;
            loForm.ShowDialog();&lt;br&gt;
&lt;br&gt;
            loForm.Dispose();&lt;br&gt;
&lt;br&gt;
            //NOT Workign OK&lt;br&gt;
            loForm = (PaymentForm) Activator.CreateInstance(Type.GetType("JK.Payment.UI.Windows.Forms.PaymentForm"),&lt;br&gt;
                                                            new object[]&lt;br&gt;
                                                                {&lt;br&gt;
                                                                    JK.Payment.Enums.TxnType.Sale, salesBO.SaleNo,&lt;br&gt;
                                                                    salesBO.Total&lt;br&gt;
                                                                });&lt;br&gt;
&lt;br&gt;
            loForm.ShowDialog();&lt;br&gt;
            loForm.Dispose();&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Any advice? Thank you</description><pubDate>Sun, 26 Aug 2007 08:59:24 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost4109.aspx</link><description>Does the fully qualified name work in a test scenario when you manually call the Activator.CreateInstance()?</description><pubDate>Thu, 02 Nov 2006 14:08:12 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost4106.aspx</link><description>&lt;FONT size=2&gt;&lt;P&gt;I checked the designer code and it looks like it is already using the fully qualified name for the form, including the namespace BBS.GUI.&amp;nbsp; This is the code from the designer:&lt;/P&gt;&lt;P&gt;BusinessObjectTranslationItem3.DestinationBusinessObject = &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"frmCliBroker.CliBrokerBO"&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;BusinessObjectTranslationItem3.SourceBusinessObject = &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"frmClientInfo.CliBrokerBO"&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.ChildFormBrokerRel.BusinessObjectTranslations.AddRange(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslationItem() {BusinessObjectTranslationItem3})&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.ChildFormBrokerRel.ChildForm = &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"BBS.GUI.frmCliBroker"&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.ChildFormBrokerRel.ParentForm = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 02 Nov 2006 14:02:45 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost4103.aspx</link><description>Actually, you can use a referenced form from a DLL.&amp;nbsp; But the problem may be that the full name (i.e. YourNameSpace.YourForm) may not be valid through the reference that is being specified.&amp;nbsp; You may need to load the assembly.&amp;nbsp; For example, open your designer file and go to the ChildForm property in the designer file.&amp;nbsp; You will see the name of the form like something I mentioned above.&amp;nbsp; See if your activator.CreateInstance works with the full name rather than the type:&lt;/P&gt;&lt;P&gt;Activator.CreateInstance("YourNameSpace.YourFormName")</description><pubDate>Thu, 02 Nov 2006 13:48:00 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost4101.aspx</link><description>OK, I sort of figured it out.&amp;nbsp; Not sure what this means and pretty sure it's not supposed to work this way.&amp;nbsp; I have&amp;nbsp;a local form which I set as the ChildForm, and this works fine...no problems.&amp;nbsp; This works without creating an instance of the local form.&amp;nbsp; When I try to set the ChildForm to a form coming from a referenced DLL it gives me the error.&amp;nbsp; However, if I create an instance of the form (with any name) it works fine.&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;This code works for forms in same project:&lt;/P&gt;&lt;P&gt;ChildFormDialog1.ShowDialog()&lt;/P&gt;&lt;P&gt;This code works for forms from dlls where ChildFormDialog1 has ChildForm=frmChildForm:&lt;/P&gt;&lt;P&gt;Dim ChildFormDLL as New frmChildForm&lt;BR&gt;ChildFormDialog1.ShowDialog</description><pubDate>Thu, 02 Nov 2006 13:39:00 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost4098.aspx</link><description>First see if you can just call Activator.CreateInstance on it.&lt;/P&gt;&lt;P&gt;Dim loForm As System.WIndows.Forms.Form&lt;/P&gt;&lt;P&gt;loForm = CType(Activator.CreateInstance(GetType(MyFormType)), System.WIndows.Forms.Form)&lt;/P&gt;&lt;P&gt;loForm.SHowDialog()</description><pubDate>Thu, 02 Nov 2006 13:25:34 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost4094.aspx</link><description>I understand what you're saying, but what doesn't make sense to me here is that I can instantiate the form which I am using as the child&amp;nbsp;and call a show on it, without using the ChildFormDialog control and it shows fine.&amp;nbsp; There must be something that acts differently when using this control.&amp;nbsp; Maybe something to do with the way the translations?&amp;nbsp; I'm just guessing here...not sure how to go about debugging this.</description><pubDate>Thu, 02 Nov 2006 13:16:19 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: ChildFormDialog error</title><link>http://forum.strataframe.net/FindPost4083.aspx</link><description>There's nothing magic done here...we just call an Activator.CreateInstance and pass the type that you specify for the child dialog form.&amp;nbsp; Once thing that tends to cause an error is when the ChildForm is expecting a parameter in the New and you do not provide that parm in the ShowDialog:&lt;/P&gt;&lt;P&gt;MyChildDialogControl.ShowDialog(YourParms)</description><pubDate>Thu, 02 Nov 2006 11:47:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>