TRamaglia

Hello all,

I have read somewhere that there is a bug in the compact framework when passing logic over to another form when using application.run(new formTest). I have tested this and receive a system.ArgumentException. Can anyone confirm the validity of this statement or redirect me to some documentation (online or off) that would explain this in better form. Thanks in advance.

Tom



Re: .NET Compact Framework known bug in the compact framework???

Ilya Tumanov

Please read this, items 9, 10, 12, 17.






Re: .NET Compact Framework known bug in the compact framework???

TRamaglia

Thanks for the tips in the link.

I am running my application on a iPaq 2495 with .Net CF 1.1. When I call Application.Run(new form1() the form being called DOES run, but always throw an ArgumentException at the same time and must catch it in order for my new form to load. I find this kind of strange. Is this a known bug . The code is below. Thanks in advance.

Try

Application.Run(New Reports)

Catch argEx As ArgumentException

'the exception is thrown after the form loads, if it is not caught the new form WILL NOT load.

Catch ex As Exception

Finally

End Try





Re: .NET Compact Framework known bug in the compact framework???

TRamaglia

Actually, I think the problem might lie in the fact that I am using Application.Run() to load another form. Do you think this might be the case, If so what would you recommend. CalledForm.show and CallingForm.hide thanks in advance.





Re: .NET Compact Framework known bug in the compact framework???

Ilya Tumanov

Yes, you should not use Application.Run() more than once. Form.Show() or Form.ShowDialog() should be used to show other forms. Form.Hide() can be used to hide form as needed (e.g. if you intended to show it again at some point) or Form.Close() can be used to close it if form in not needed anymore. Also make sure do call Dispose() on forms you no longer need.






Re: .NET Compact Framework known bug in the compact framework???

TRamaglia

It seems like Hide() is my only option when using the Show() method on a form instance. I try running this code and my app automatically closes after the call the Me.Close() The same happens for Dispose(). Thoughts Thanks

Dim reports As New Reports

reports.Show()

' Application.Run(New Reports)

Me.Close()





Re: .NET Compact Framework known bug in the compact framework???

Ilya Tumanov

That's because you're calling Me.Close() on your main form (the one in Application.Run()). That closes the application.

You can hide main form if you can do nothing because second form would be on top of it and that¡¯s what user would see.






Re: .NET Compact Framework known bug in the compact framework???

TRamaglia

That makes a lot of sense. Thanks a bunch Ilya, you were very helpful.

Thanks,

Tom