cluless what is happening
-
I am getting an exception as System.InvalidOperationException, Additional Info: It is invalid to start a second message loop on a single thread. Use application.RunDialog or Form.ShowDialog. My code is:
class cINI
{
[STAThread]
static void Main()
{
//some code
InitApp();
}
private static void InitApp
{
//here i m creating a form obj
frmFirst obj = new frmFirst();
obj.ShowDialog();
}
internal static void StartApp()
{
clsLogin = new cLogin(dbUtils); // login check form obj
if(clsLogin.ShowLogin() == DialogResult.Ok)
Application.Run(new frmMain());
}
}Now the frmFirst : Here On Button click event i want to call the StartApp method, so i write
cINI.StartApp();
-
I am getting an exception as System.InvalidOperationException, Additional Info: It is invalid to start a second message loop on a single thread. Use application.RunDialog or Form.ShowDialog. My code is:
class cINI
{
[STAThread]
static void Main()
{
//some code
InitApp();
}
private static void InitApp
{
//here i m creating a form obj
frmFirst obj = new frmFirst();
obj.ShowDialog();
}
internal static void StartApp()
{
clsLogin = new cLogin(dbUtils); // login check form obj
if(clsLogin.ShowLogin() == DialogResult.Ok)
Application.Run(new frmMain());
}
}Now the frmFirst : Here On Button click event i want to call the StartApp method, so i write
cINI.StartApp();