One Istance of the application
-
I want only one instance of my application to run at a time. So i have creted a CSemaphore object with a name "app" in the global area. And in the Initinstance of the app class i am checking whether it is locked or not. if not locked, locking it and continue otherwise, return false. Its working fine. What i want to know is how can the CSemaphore object exists between the two different applications even when the application is closed? Thanks in advance for the reply.
KIRAN PINJARLA
-
I want only one instance of my application to run at a time. So i have creted a CSemaphore object with a name "app" in the global area. And in the Initinstance of the app class i am checking whether it is locked or not. if not locked, locking it and continue otherwise, return false. Its working fine. What i want to know is how can the CSemaphore object exists between the two different applications even when the application is closed? Thanks in advance for the reply.
KIRAN PINJARLA
-
The Semaphore is actually like a system-wide flag - it's handled by the OS. Once you create (and lock) the named semaphore from one instance of your application, Windows will not let you do that in the second instance ...
Thank you
KIRAN PINJARLA
-
I want only one instance of my application to run at a time. So i have creted a CSemaphore object with a name "app" in the global area. And in the Initinstance of the app class i am checking whether it is locked or not. if not locked, locking it and continue otherwise, return false. Its working fine. What i want to know is how can the CSemaphore object exists between the two different applications even when the application is closed? Thanks in advance for the reply.
KIRAN PINJARLA
for single instance my preference is alwways mutex due to memory overhead and other thing!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You