Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class SplashFrm
- Private WithEvents DoSomeWork As ValidateCls
- Private Sub SplashFrm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- Me.Show()
- DoSomeWork = New ValidateCls
- Application.DoEvents()
- DoSomeWork.doWorks()
- End Sub
- Private Sub React() Handles DoSomeWork.WorkFinished
- LoginFrm.Show()
- Me.Close()
- End Sub
- End Class
- Public Class ValidateCls
- Public Event WorkFinished()
- Sub doWorks()
- AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf OnUnhandledException
- Try
- 'here code to validate licenses.
- 'i can not put the code, but it works fine because I can see that is validating ok.
- Catch ex As Exception
- SaveError("ValidateCls-1", ex.ToString)
- End
- End Try
- RaiseEvent WorkFinished()
- End Sub
- Private Sub OnUnhandledException(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
- Try
- HandleUnhandledException(e.ExceptionObject)
- Catch ex As Exception
- End Try
- End Sub
- Private Sub HandleUnhandledException(ByVal o As Object)
- If o Is Nothing Then Return
- Try
- Dim e As Exception = DirectCast(o, Exception)
- MessageBox.Show(e.StackTrace, "Unhandled exception.")
- Catch ex As Exception
- MessageBox.Show(ex.Message, "Unhandled exception.")
- Finally
- Application.Exit()
- End Try
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement