I use .NET CF and VS 2005 to write application. How can I do global
exception handling?
I tried following code:
Imports System.Runtime.InteropServices
'application class
Public Class TTApplication
Public Shared Sub Run(ByVal form As Form)
form.Show()
Dim m As MSG
Dim ptr As IntPtr = IntPtr.Zero
While GetMessage(m, ptr, 0, 0)
Try
TranslateMessage(m)
DispatchMessage(m)
Catch e As Exception
MessageBox.Show(e.Message)
End Try
End While
End Sub
<MTAThread()> _
Public Shared Sub Main()
Dim f As Form = New Form()
TTApplication.Run(f)
End Sub
End Class
After first unhandling exception in application I got WM_QUIT message.
I tried to ignore first WM_QUIT but application was halting.
Any suggestion?
--
Dmitry