Click here to Skip to main content
15,891,993 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLimiting an application to single instance...problem? [modified] Pin
Vinod Sankaranarayanan13-Aug-06 23:16
Vinod Sankaranarayanan13-Aug-06 23:16 
QuestionRe: Limiting an application to single instance...problem? Pin
prasad_som13-Aug-06 23:44
prasad_som13-Aug-06 23:44 
AnswerRe: Limiting an application to single instance...problem? Pin
Vinod Sankaranarayanan14-Aug-06 0:01
Vinod Sankaranarayanan14-Aug-06 0:01 
GeneralRe: Limiting an application to single instance...problem? Pin
prasad_som14-Aug-06 0:15
prasad_som14-Aug-06 0:15 
GeneralRe: Limiting an application to single instance...problem? Pin
Vinod Sankaranarayanan14-Aug-06 1:08
Vinod Sankaranarayanan14-Aug-06 1:08 
GeneralRe: Limiting an application to single instance...problem? Pin
Milton Karimbekallil14-Aug-06 1:42
Milton Karimbekallil14-Aug-06 1:42 
GeneralRe: Limiting an application to single instance...problem? Pin
Vinod Sankaranarayanan14-Aug-06 2:34
Vinod Sankaranarayanan14-Aug-06 2:34 
GeneralRe: Limiting an application to single instance...problem? Pin
Waldermort14-Aug-06 2:10
Waldermort14-Aug-06 2:10 
When the first instance starts execution, the very first thing it should do is check for a mutex, if not found it should create one. When the second instance starts, it should check for the mutex, when it finds it it should terminate.

Look at the CreateMutex() and GetLastError() functions.

I'm not sure where to do this in MFC, but in Win32 these routines are the first to be executed in WinMain(). Also note all of this should be done before creating/reading any other variables.

I have a header file containing all these functions and a few more like handling Command line paramaters, and handling MultiUser/MultiDesktop environments. (A modified combination of CP examples). If you like I will send it to you.
GeneralRe: Limiting an application to single instance...problem...solution [modified] Pin
Vinod Sankaranarayanan14-Aug-06 2:36
Vinod Sankaranarayanan14-Aug-06 2:36 
GeneralRe: Limiting an application to single instance...problem? Pin
prasad_som15-Aug-06 18:49
prasad_som15-Aug-06 18:49 
QuestionHow to vopy data pointed by a "Void* " pointer to "CString" object Pin
VCSharp00713-Aug-06 23:15
VCSharp00713-Aug-06 23:15 
AnswerRe: How to vopy data pointed by a "Void* " pointer to "CString" object Pin
Waldermort14-Aug-06 1:59
Waldermort14-Aug-06 1:59 
AnswerRe: How to vopy data pointed by a "Void* " pointer to "CString" object Pin
ajisthekingofpop14-Aug-06 5:45
ajisthekingofpop14-Aug-06 5:45 
AnswerRe: How to vopy data pointed by a "Void* " pointer to "CString" object Pin
Joe Woodbury14-Aug-06 12:32
professionalJoe Woodbury14-Aug-06 12:32 
QuestionMulticolumn CListCtrl & custom DrawItem Pin
Martijn van Kleef13-Aug-06 22:30
Martijn van Kleef13-Aug-06 22:30 
AnswerRe: Multicolumn CListCtrl & custom DrawItem Pin
Milton Karimbekallil13-Aug-06 23:52
Milton Karimbekallil13-Aug-06 23:52 
AnswerRe: Multicolumn CListCtrl & custom DrawItem Pin
Hamid_RT14-Aug-06 1:18
Hamid_RT14-Aug-06 1:18 
QuestionAccess to other computer. How to? Pin
thangnvhl13-Aug-06 21:22
thangnvhl13-Aug-06 21:22 
AnswerRe: Access to other computer. How to? Pin
Milton Karimbekallil13-Aug-06 22:55
Milton Karimbekallil13-Aug-06 22:55 
GeneralRe: Access to other computer. How to? Pin
thangnvhl14-Aug-06 0:27
thangnvhl14-Aug-06 0:27 
GeneralRe: Access to other computer. How to? Pin
thangnvhl15-Aug-06 22:46
thangnvhl15-Aug-06 22:46 
GeneralRe: Access to other computer. How to? Pin
thangnvhl15-Aug-06 22:46
thangnvhl15-Aug-06 22:46 
QuestionCListCtrl Please Help ! [modified] Pin
Bravoone_200613-Aug-06 21:00
Bravoone_200613-Aug-06 21:00 
AnswerRe: CListCtrl Please Help ! Pin
Hamid_RT13-Aug-06 21:50
Hamid_RT13-Aug-06 21:50 
AnswerRe: CListCtrl Please Help ! Pin
Bravoone_200613-Aug-06 23:11
Bravoone_200613-Aug-06 23:11 

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.