G
Guest
I have searched this board for an example and also read Cor's link to the Google thread. I have an application with a startup module called mStartup. My application, after compiled is called CPViewer.exe Here is the code from the Sub Main:
Dim owned As Boolea
Dim mut As New System.Threading.Mutex(True, "CPViewer.exe", owned
Sub main(
If owned The
Application.Run(New frmVertical
mut.ReleaseMutex(
Els
Application.Exit(
End I
End Su
I believe the code is correct, however, what do i need to put in place of the "Application.Exit()" to get the second instance to stop immediately and clean up after itself? As it is now, I continues execution of the code after reading the line. "Application Exit()" seems to work the way I want if it's in a form but not in a module. If I ut "End" in place of "Application Exit()" it stops but I gather from reading here that that's not the proper way to do things
Thanks
John
Dim owned As Boolea
Dim mut As New System.Threading.Mutex(True, "CPViewer.exe", owned
Sub main(
If owned The
Application.Run(New frmVertical
mut.ReleaseMutex(
Els
Application.Exit(
End I
End Su
I believe the code is correct, however, what do i need to put in place of the "Application.Exit()" to get the second instance to stop immediately and clean up after itself? As it is now, I continues execution of the code after reading the line. "Application Exit()" seems to work the way I want if it's in a form but not in a module. If I ut "End" in place of "Application Exit()" it stops but I gather from reading here that that's not the proper way to do things
Thanks
John