limit app to one instance
-
hi all:) i have a mfc dialog application in Visual Studio 2005. How to limit it to one instance ? thank you.
-
hi all:) i have a mfc dialog application in Visual Studio 2005. How to limit it to one instance ? thank you.
Hi A common way to handle one instance is using an identifier
BOOL CMyApp::InitInstance() { HANDLE hMutex = CreateMutex (NULL, TRUE, "MY APP IDENTIFICATION"); if (GetLastError() == ERROR_ALREADY_EXISTS) { AfxMessageBox("Alreay running!"); return FALSE; } if(hMutex) ReleaseMutex (hMutex); ... }
CU Timen -
hi all:) i have a mfc dialog application in Visual Studio 2005. How to limit it to one instance ? thank you.
-
hi all:) i have a mfc dialog application in Visual Studio 2005. How to limit it to one instance ? thank you.
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
-
hi all:) i have a mfc dialog application in Visual Studio 2005. How to limit it to one instance ? thank you.
big_denny_200 wrote:
How to limit it to one instance ?
http://www.codeproject.com/cpp/csingleinst.asp[^]
"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