Re: already running




"Dave O." <nobody@xxxxxxxxxxx> wrote in message
news:%23%23hDKniuHHA.5072@xxxxxxxxxxxxxxxxxxxxxxx
It depends how critical it is to have a single instance and how devious
your
users are.
App.PrevInstance can be fooled by making a copy of the executable and
renaming it.
If you need to avoid that possibility research on MUTEX, however if it is
not a potential problem then App.PrevInstance will be adequate.

Regards
Dave O.


To add another petty distinction. App.PrevInstance also depends on an app
being fully initialized. So if you have an App that takes a bit of time on
start-up it is possible for a user with rapid clicks to launch several
instances.

IHMO, adding Mutex functionality is simple and avoids all short falls, so
why not use it? Set it and forget it. <g>

Here is one way...
http://www.vbaccelerator.com/home/VB/Code/Libraries/Shell_Projects/Registering_File_Associations/article.asp
Here is another...
http://vbusers.com/code/codeget.asp?ThreadID=275&PostID=1&NumReplies=0

-ralph



.



Relevant Pages

  • Re: IOCP critical sections and mutexes
    ... then there is some bug in your ... routines but I recently started some preliminary stress test on a new server ... then pushes it in a queue that will be later processed by my main app ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: IOCP critical sections and mutexes
    ... those are pulled from the queue via GetQueuedCompletionStatus ... BTW, for the record, both the user mode accessible mutex and critical ... My packets never go over 2k in size. ... then pushes it in a queue that will be later processed by my main app ...
    (microsoft.public.win32.programmer.kernel)
  • Re: IOCP critical sections and mutexes
    ... mismatch and invalid 'this' pointer). ... instance) and I get pretty much the same crash. ... I mush have done something stupid in my main thread app. ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: IOCP critical sections and mutexes
    ... just deleted object. ... My packets never go over 2k in size. ... then pushes it in a queue that will be later processed by my main app ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Mutex Problem
    ... the slave can) then yes, you can use CreateMutex in the master and OpenMutex ... Note, however, that if the slave app starts earlier, then it ... would not get the mutex. ... shared memory, and for this reason each of these applications tries to create ...
    (microsoft.public.platformsdk.security)