-
January 19th, 2010, 08:29 PM
#1
Prevent another instance of application from running
Hi,
How can I prevent another instance of my MFC application from running? I'm using Visual Studio 2005. Thank you.
-
January 19th, 2010, 10:43 PM
#2
Re: Prevent another instance of application from running
-
January 20th, 2010, 03:37 AM
#3
Re: Prevent another instance of application from running
Thanks! I used the information here instead.
Last edited by galapogos; January 20th, 2010 at 03:52 AM.
-
January 20th, 2010, 07:01 AM
#4
Re: Prevent another instance of application from running
Originally Posted by galapogos
Thanks! I used the information here instead.
Well, there is a "full version" of how to solve the problem: Avoiding Multiple Application Instances
Victor Nijegorodov
-
January 20th, 2010, 07:46 AM
#5
Re: Prevent another instance of application from running
Originally Posted by Nikitozz
The 'instance count' in a shared data segment, while valid if implemented correctly (which it isn't here as the 'lock' and 'lock check' are independant and thus could result in a failure), is a less than ideal solution for various reasons, a shared data segment for one may not give you the desired operation when running on a terminal server or when using fast user switching.
Using a mutex (either global or local) remains to be simple and more guaranteed to work properly under all conditions.
At least none seem to be suggesting the window approach. that's just really major fail trying to solve it that way :-p
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|