SIMIN Posted July 24, 2008 Posted July 24, 2008 Hello, My application is written in VB.NET 2008, and I want to catch CantStartSingleInstanceException exception. I have read the following links: http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.applicationservices.cantstartsingleinstanceexception(VS.80).aspx http://msdn.microsoft.com/en-us/library/ms127539.aspx http://forums.msdn.microsoft.com/en/csharplanguage/thread/3cd5bd24-f409-4779-8d72-73aa5d452967/ But cannot find how to catch this exception. Anyone knows? Quote
Administrators PlausiblyDamp Posted July 28, 2008 Administrators Posted July 28, 2008 Under what situation have you managed to get this exception thrown? Also have you tried handling it in the MyApplication_UnhandledException event? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
OMID SOFT Posted July 28, 2008 Posted July 28, 2008 Hope the following code snippet should be helpful for you. I believe you should be able to add this snippet appropriately to your code. Imports Microsoft.VisualBasic.ApplicationServices Namespace My ... Partial Friend Class MyApplication Private Sub MyApplication_CantStartSingleInstanceException(ByVal sender As Object, _ ByVal e As StartupNextInstanceEventArgs) Handles Me.StartupNextInstance ' Take Necessary Action MessageBox.Show("Single Instance Only") End Sub End Class ... End Namespace Quote Don't ask what your country can do for you, ask what you can do for your country...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.