I've created a Single Instance application using the following code:
if(NULL != ::CreateMutex(NULL, TRUE,_T("CSingleInstanceApp")))
long dwError = ::GetLastError();
if(dwError == ERROR_ALREADY_EXISTS)
// MessageBox(NULL,L"You are Already Running Application.",L"ERROR!!",MB_OK);
I've designed one project as a template and used it to build many applications. e.g I tried to run one application named "app2" while another application named "app1" is already running. But "app2" does not run. I don't want this. "app2" should not run if and only if "app2" is already running. Otherwise it has to run normal. How to do this?
If I read your correctly, the name of mutex should be unique ,pass some unique string while creating first instance of app1,app2 and so on. the reason you are getting problem you are using the same mutex name for all the application.
My MSAA Hook dll is expected to be loaded into all process's memory. in 32 bits Win7 it works.
But in win7 64 bits some process can load MSAAHook.dll 64 bits cannot be loaded into some 64 bits process. Why does this happens?
A Windows process has to be homogeneous; you can't mix 32-bit and 64-bit code in a single process, Windows can't handle that. If your DLL works fine in a 32-bit environment, you'll need another one to get it working in a 64-bit world.