StrataFrame Forum

Wierdness in new SF Windows App

http://forum.strataframe.net/Topic2345.aspx

By Daniel Essin - 8/21/2006

I created a new SF Windows App, added a few controls and bo's and hit run and got a complaint about:



private static void InitApplication(InitializingApplicationEventArgs e)

{

//-- Add the main form type

//-- If more than one form is added to the collection, they can be chosen by showing a "Gateway" form

// and supplying the index of the form to show (At least 1 form type must be added to the collection

e.Forms.Add(typeof(MainForm.ResultSetBuilder));



//-- ToDo: Add any extra application initialization

MicroFour.StrataFrame.UI.Localization.MessageKeyType = MicroFour.StrataFrame.Messaging.MessageKeyDataType.XML;

MicroFour.StrataFrame.UI.Localization.MessageLocaleID = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage("ResultSetBuilder", "", false); ;

}





The project is named ResultSetBuilder and the form is named MainForm.

I don't understand why the code generator put this:

MainForm.ResultSetBuilder



in the e.Forms.Add



Removing the .ResultSetBuilder obviously resolves the runtime error.
By StrataFrame Team - 8/22/2006

I'm not sure exactly what happened either... when you add a new SF winforms app, the template for that line of code looks like this:

e.Forms.Add(typeof($safeprojectname$.Form1));

So, the project name (which is the default namespace) would be put first, and then the text "Form1" would be put.  Since "Form1" is not anywhere to be seen in the code that you posted, I can only assume that the line was modified by hand after the project was created, or that the C# refactor tool failed to properly rename the form from Form1 to MainForm.

By Daniel Essin - 8/22/2006

I'll try again. Probably just a fluke.

Thanks.
By StrataFrame Team - 8/23/2006

Yes, I've seen the C# refactor do some strange things... it only guarantees that the renaming will complete successfully if the project can successfully build and has been built recently.