Click here to Skip to main content
15,919,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
Arsalan Malik13-Sep-04 19:24
Arsalan Malik13-Sep-04 19:24 
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
Neeranjan13-Sep-04 19:40
Neeranjan13-Sep-04 19:40 
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
Anonymous14-Sep-04 0:47
Anonymous14-Sep-04 0:47 
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
lookforme_prash14-Sep-04 0:52
lookforme_prash14-Sep-04 0:52 
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
Neeranjan14-Sep-04 18:46
Neeranjan14-Sep-04 18:46 
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
lookforme_prash14-Sep-04 19:58
lookforme_prash14-Sep-04 19:58 
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
Neeranjan14-Sep-04 20:16
Neeranjan14-Sep-04 20:16 
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
lookforme_prash14-Sep-04 20:22
lookforme_prash14-Sep-04 20:22 
It can be the first statement of initinstance

BOOL CMyApp::InitInstance()
{
SECURITY_ATTRIBUTES secAttributes ;
secAttributes.nLength = sizeof (SECURITY_ATTRIBUTES);
secAttributes.lpSecurityDescriptor = NULL ;
secAttributes.bInheritHandle = FALSE ;

CreateMutex (&secAttributes, TRUE, "prashant");

if (GetLastError () == ERROR_ALREADY_EXISTS)
{
::MessageBox (NULL, "Application already running", "Prashant",MB_ICONEXCLAMATION);
_exit(0);
}
//Rest of the code of initinstance

}


Regards,
Prashant
GeneralRe: Handling multiple instances of an application in VC++ 6.0 Pin
Neeranjan14-Sep-04 20:48
Neeranjan14-Sep-04 20:48 
GeneralWin32 Pin
wow999913-Sep-04 17:40
wow999913-Sep-04 17:40 
GeneralRe: Win32 Pin
PJ Arends13-Sep-04 18:21
professionalPJ Arends13-Sep-04 18:21 
GeneralCom port enable Pin
anuchelvi13-Sep-04 17:10
anuchelvi13-Sep-04 17:10 
GeneralRe: Com port enable in menu bar Pin
anuchelvi13-Sep-04 21:12
anuchelvi13-Sep-04 21:12 
GeneralRe: Com port enable in menu bar Pin
shiraztk13-Sep-04 21:31
shiraztk13-Sep-04 21:31 
GeneralRe: Com port enable in menu bar Pin
Hardy_Smith13-Sep-04 21:32
Hardy_Smith13-Sep-04 21:32 
GeneralChange Icon of exe Pin
Archer28213-Sep-04 14:17
Archer28213-Sep-04 14:17 
GeneralRe: Change Icon of exe Pin
the_augy13-Sep-04 14:37
the_augy13-Sep-04 14:37 
GeneralRe: Change Icon of exe Pin
Archer28213-Sep-04 14:40
Archer28213-Sep-04 14:40 
GeneralRe: Change Icon of exe Pin
the_augy13-Sep-04 15:20
the_augy13-Sep-04 15:20 
GeneralRe: Change Icon of exe Pin
Archer28213-Sep-04 15:45
Archer28213-Sep-04 15:45 
GeneralRe: Change Icon of exe Pin
the_augy13-Sep-04 16:21
the_augy13-Sep-04 16:21 
GeneralRe: Change Icon of exe Pin
Arsalan Malik13-Sep-04 18:49
Arsalan Malik13-Sep-04 18:49 
GeneralRe: Change Icon of exe Pin
Ryan Binns13-Sep-04 20:50
Ryan Binns13-Sep-04 20:50 
GeneralLocalization of negative numbers Pin
PJ Arends13-Sep-04 13:15
professionalPJ Arends13-Sep-04 13:15 
GeneralRe: Localization of negative numbers Pin
cmk13-Sep-04 23:42
cmk13-Sep-04 23:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.