Re: How to allow a specific number of Instances of my app?
- From: "expvb" <nobody@xxxxxxx>
- Date: Sun, 29 Oct 2006 23:11:25 -0500
"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:GfKdnR6EFKZm69jYnZ2dnUVZ_sidnZ2d@xxxxxxxxxxxxxxx
I doubt that VB implements App.PrevInstance using a Mutex/Semaphore as it
is
so easily fooled. That's why the 'work-around', a Mutex, is often
suggested
as a more reliable mechanism.
The reason App.PrevInstance can be easily fooled is that the user can make a
copy of the EXE, rename it or put it into a different folder and run the EXE
twice. Under the hood, VB6 uses the current EXE fully qualified path as a
mutex/semaphore, so if the user renamed the EXE, a different mutex/semaphore
is created. In this case, App.PrevInstance is fooled, so the solution is to
make a mutex that is not dependant on the file name.
One must also use the "Global\" prefix in certain OS'es(after checking the
version number) to prevent the user from running a second copy of the app in
another terminal server session, or a second session in XP fast user
switching. I think if not specified, it's considered local to the session by
default.
.
- Follow-Ups:
- References:
- Re: How to allow a specific number of Instances of my app?
- From: Ralph
- Re: How to allow a specific number of Instances of my app?
- From: Ralph
- Re: How to allow a specific number of Instances of my app?
- From: expvb
- Re: How to allow a specific number of Instances of my app?
- From: Ralph
- Re: How to allow a specific number of Instances of my app?
- From: expvb
- Re: How to allow a specific number of Instances of my app?
- From: Ralph
- Re: How to allow a specific number of Instances of my app?
- Prev by Date: Re: Newbie help please
- Next by Date: Re: enumerate existing comm ports
- Previous by thread: Re: How to allow a specific number of Instances of my app?
- Next by thread: Re: How to allow a specific number of Instances of my app?
- Index(es):
Relevant Pages
|