Click here to Skip to main content
15,921,577 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: run a perticuler registry key ? Pin
valikac23-Oct-02 18:02
valikac23-Oct-02 18:02 
GeneralRe: run a perticuler registry key ? Pin
Todd Smith23-Oct-02 18:12
Todd Smith23-Oct-02 18:12 
GeneralMutex problem Pin
Abin23-Oct-02 15:54
Abin23-Oct-02 15:54 
GeneralRe: Mutex problem Pin
l a u r e n23-Oct-02 17:08
l a u r e n23-Oct-02 17:08 
GeneralRe: Mutex problem Pin
includeh1024-Oct-02 6:51
includeh1024-Oct-02 6:51 
GeneralRe: Mutex problem Pin
Alvaro Mendez24-Oct-02 9:13
Alvaro Mendez24-Oct-02 9:13 
GeneralRe: Mutex problem Pin
Abin24-Oct-02 9:38
Abin24-Oct-02 9:38 
GeneralRe: Mutex problem Pin
Alvaro Mendez24-Oct-02 9:56
Alvaro Mendez24-Oct-02 9:56 
Yep, I tried it and it blew up on me too. For some reason it didn't like the name of the mutex (with the backslashes). I replaced the backslashes with regular slashes and it works like a champ. I also changed to code to be a little simpler:


// Get the app's full path, but with regular slashes
CString strMutex;
::GetModuleFileName(NULL, strMutex.GetBuffer(MAX_PATH), MAX_PATH);
strMutex.ReleaseBuffer();
strMutex.Replace('\\', '/');

// Create a temporary mutex to check if it's already running
static CMutex mutex(FALSE, strMutex);
if (::GetLastError() == ERROR_ALREADY_EXISTS)
    return FALSE;  // already running in the same folder


Regards,
Alvaro

There is much pleasure to be gained from useless knowledge. - Bertrand Russell
GeneralRe: Mutex problem Pin
Abin24-Oct-02 10:07
Abin24-Oct-02 10:07 
Questionis there any change in logic ? Pin
imran_rafique23-Oct-02 15:47
imran_rafique23-Oct-02 15:47 
AnswerRe: is there any change in logic ? Pin
valikac23-Oct-02 17:37
valikac23-Oct-02 17:37 
GeneralRe: is there any change in logic ? Pin
imran_rafique24-Oct-02 15:15
imran_rafique24-Oct-02 15:15 
GeneralRe: is there any change in logic ? Pin
valikac24-Oct-02 15:50
valikac24-Oct-02 15:50 
Questionhow to make? Pin
imran_rafique23-Oct-02 15:15
imran_rafique23-Oct-02 15:15 
AnswerRe: how to make? Pin
Christian Graus23-Oct-02 16:28
protectorChristian Graus23-Oct-02 16:28 
GeneralRe: how to make? Pin
imran_rafique23-Oct-02 16:47
imran_rafique23-Oct-02 16:47 
GeneralRe: how to make? Pin
Christian Graus23-Oct-02 17:00
protectorChristian Graus23-Oct-02 17:00 
GeneralRe: how to make? Pin
imran_rafique23-Oct-02 17:34
imran_rafique23-Oct-02 17:34 
GeneralRe: how to make? Pin
Christian Graus23-Oct-02 17:54
protectorChristian Graus23-Oct-02 17:54 
GeneralRe: how to make? Pin
imran_rafique24-Oct-02 16:31
imran_rafique24-Oct-02 16:31 
GeneralSmall icon vs Large icon Pin
Paul Oss23-Oct-02 12:49
Paul Oss23-Oct-02 12:49 
GeneralRe: Small icon vs Large icon Pin
Paul M Watt23-Oct-02 13:18
mentorPaul M Watt23-Oct-02 13:18 
GeneralRe: Small icon vs Large icon Pin
Paul Oss23-Oct-02 16:45
Paul Oss23-Oct-02 16:45 
GeneralRe: Small icon vs Large icon Pin
Paul M Watt23-Oct-02 18:34
mentorPaul M Watt23-Oct-02 18:34 
GeneralRe: Small icon vs Large icon Pin
Michael Dunn23-Oct-02 13:30
sitebuilderMichael Dunn23-Oct-02 13:30 

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.