Question
We have multiple MFC apps, which use CMutex( false, "blah" ), where "blah" allows the mutex to work across process boundaries.
One of these apps was re-written without MFC (using Qt instead). How can I simulate the CMutex using Win32 calls? (Qt's QMutex is not inter-process.) I prefer not to modify the MFC apps.
Solution
For inter-process mutexes you want these calls:
These are the underlying Win32 API calls that CMutex is a wrapper around.
For in-process only mutexes you can also use these calls, which are faster:
OTHER TIPS
The following funcs will probably be what you want, they are all documented on MSDN.
CreateMutex(...)
WaitForSingleObject(...)
ReleaseMutex(...)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow