In my c# win-forms application, I have changed the following line in Main()
Application.Run(new MainMenuForm());
as
MainMenuForm mainMenuForm = new MainMenuForm();
mainMenuForm.ShowDialog();
Is it the cause of the above error?
Stack trace shows following method causes the exception
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc()
Any help appreciated
Thanks
You need to use Application.Run on some form because it starts message loop on your main gui thread for WinProc.
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.run.aspx