1

i have one very annoying problem.

I'm dynamicaly loading assemblies, which have forms in it. The problem is that whenever i close ANY form from assembly which si the last which wasn't closed - i get exception which kills my application.

loading code:

  Assembly a = Assembly.LoadFrom(Common.Config.Path + pb.CallAssembly);
            FormBase f = (FormBase)a.CreateInstance(pb.CallClass);
            f.Show();

the exception i get:

   at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar)
   at System.Windows.Forms.Control.get_Text()
   at Common.Controls.TextBoxExtended.HandleMask()
   at Common.Controls.TextBoxExtended.OnKeyUp(KeyEventArgs e)
   at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
   at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
   at System.Windows.Forms.Application.Run(Form fm)
   at xxxxxxxxxX.Program.Main()

The thing is that no matter which form i close, if it's the last one open in assembly-it makes exception. Maybe Windows Mobile 6.5 tries to dispose last object and then release assembly which is not good and application hangs.

Am also using MultiThreading. And events, but before closing i unregistering from all events form is listening to.

Is there any way to catch such exceptions? i would like to ignore them. If i can't fix

Tommix
  • 443
  • 4
  • 15
  • You told us where the exception happened, but not what the exception is. – ctacke Mar 29 '14 at 03:49
  • Null exeption(when i debug exception it shows null-it's not set)..there is no any description, only inner exception which i provided here. – Tommix Mar 30 '14 at 11:55
  • Did you have a look at this one? http://stackoverflow.com/questions/13495581/targetinvocationexception-microsoft-agl-common-misc-handlearpal-error-ar – Ani May 20 '14 at 13:38

0 Answers0