all groups > visual studio .net general > november 2007 >
You're in the

visual studio .net general

group:

Problem with Windows Form


Problem with Windows Form Maria Paz
10/31/2007 7:17:03 AM
visual studio .net general:
I have a windows application with c#.
This application have 6 forms.

The line code in my program.cs is:
[STAThread]
static void Main()
{
try
{

Application.Run(new frmPrincipal());
}
catch(Exception ex)
{
throw ex;
}
}

In my frmPrincipal, i have a menustrip.
In this menustrip, I have 2 menus, and each menu I have 2 submenu.
When I click in one submenu , I using this code:
try
{
frmDescarga formulario = new frmDescarga();
formulario.Show(this);
}
catch
{
return;
}
When I use method Show , I receive this exception:
"Attempted to read or write protected memory"

When I change this formulario.Show for ShowDialog, I recieve this exception:
"{System.Runtime.InteropServices.SEHException: External component has thrown
an exception.
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageA(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ZKAdmin.AppStart.Main() in
E:\Desarrollo\WindowsApplication1\WindowsApplication1\Program.cs:line 132}"

I don't understand what is the problem.
RE: Problem with Windows Form Maria Paz
11/2/2007 12:38:05 PM
I resolved the problem.
My problem was not ShowDialog or Show method.
The source is in dll. This dll it is another company.



[quoted text, click to view]
AddThis Social Bookmark Button