J
John Bowman
Hi,
I've got the following C# code that works perfectly to prevent a 2nd
instance of my C# app:
bool bAppNotRunning = false;
Mutex MutApp = new Mutex(true, "MyC#AppMutex", out bAppNotRunning)
if(bAppNotRunning == true)
{
Run the app and do work...
MutApp.ReleaseMutex();
}
I did the same thing in another app that's in VB. NET to prevent a 2nd
instace of it:
Dim bAppNotRunning As Boolean
bAppNotRunning = False
MutApp = New Mutex(True, "MyVBAppMutex", bAppNotRunning)
If(bApNotRunning = True) Then
Run the app and do work...
MutApp.ReleaseMutex()
End If
Why doesn't the VB version work? bAppNotRunning comes back True from the
Mutex constructor even when another instance of the app is already running?!
What gives? Any ideas would be appreciated.
TIA,
I've got the following C# code that works perfectly to prevent a 2nd
instance of my C# app:
bool bAppNotRunning = false;
Mutex MutApp = new Mutex(true, "MyC#AppMutex", out bAppNotRunning)
if(bAppNotRunning == true)
{
Run the app and do work...
MutApp.ReleaseMutex();
}
I did the same thing in another app that's in VB. NET to prevent a 2nd
instace of it:
Dim bAppNotRunning As Boolean
bAppNotRunning = False
MutApp = New Mutex(True, "MyVBAppMutex", bAppNotRunning)
If(bApNotRunning = True) Then
Run the app and do work...
MutApp.ReleaseMutex()
End If
Why doesn't the VB version work? bAppNotRunning comes back True from the
Mutex constructor even when another instance of the app is already running?!
What gives? Any ideas would be appreciated.
TIA,