Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to Split a txt file. Pin
santhoshv8419-Dec-07 19:36
santhoshv8419-Dec-07 19:36 
AnswerRe: How to Split a txt file. Pin
CPallini19-Dec-07 21:16
mveCPallini19-Dec-07 21:16 
Generalerror with a /clr option Pin
tasumisra19-Dec-07 18:56
tasumisra19-Dec-07 18:56 
GeneralRe: error with a /clr option Pin
CPallini19-Dec-07 21:08
mveCPallini19-Dec-07 21:08 
GeneralRe: error with a /clr option Pin
Mark Salsbery20-Dec-07 5:49
Mark Salsbery20-Dec-07 5:49 
GeneralSolution Pin
Tausifahamad Tamboli5-Dec-10 17:45
Tausifahamad Tamboli5-Dec-10 17:45 
GeneralProblem with CreateMutex() and CloseHandle() Pin
ashishbhatt19-Dec-07 18:18
ashishbhatt19-Dec-07 18:18 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
Sarath C19-Dec-07 19:18
Sarath C19-Dec-07 19:18 
ashishbhatt wrote:

RTMPInstanceHandler instancehan;
if(!instancehan.Init())
{
// We don't allow multiple instances!
MessageBox(NULL, CString("Another instance of Application is already running!!"), CString("Server Message"), MB_OK);
instancehan.Release();
}


Where you have written the above code snippet? CloseHandle call in the release function will decrement handle count/Close the mutex you have created.

After detecting another instance your main thread should return. Probably you should do in WinMain() or InitInstace() of your Application class.

You should use your InstanceHandler class properly. i.e When first instance of the program creates, the MutexShould be created and valid throughout the life of the program.

Search in CP. it contains article on this issue.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin

GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
ashishbhatt19-Dec-07 19:32
ashishbhatt19-Dec-07 19:32 
QuestionRe: Problem with CreateMutex() and CloseHandle() Pin
Kiran Pinjala19-Dec-07 22:31
Kiran Pinjala19-Dec-07 22:31 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
Sarath C19-Dec-07 23:03
Sarath C19-Dec-07 23:03 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
Kiran Pinjala19-Dec-07 23:11
Kiran Pinjala19-Dec-07 23:11 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
Sarath C19-Dec-07 19:41
Sarath C19-Dec-07 19:41 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
ashishbhatt19-Dec-07 20:56
ashishbhatt19-Dec-07 20:56 
AnswerRe: Problem with CreateMutex() and CloseHandle() Pin
Member 75496020-Dec-07 3:37
Member 75496020-Dec-07 3:37 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
ashishbhatt24-Dec-07 18:18
ashishbhatt24-Dec-07 18:18 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
Member 75496026-Dec-07 4:51
Member 75496026-Dec-07 4:51 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
DevelopmentNoob16-Dec-09 19:56
DevelopmentNoob16-Dec-09 19:56 
GeneralRe: Problem with CreateMutex() and CloseHandle() Pin
NehaMishra286846-Dec-10 19:31
NehaMishra286846-Dec-10 19:31 
GeneralDrag Drop Pin
john563219-Dec-07 18:01
john563219-Dec-07 18:01 
GeneralRe: Drag Drop Pin
Hamid_RT19-Dec-07 18:17
Hamid_RT19-Dec-07 18:17 
GeneralHelp Needed for getting record from database Pin
Y_Kaushik19-Dec-07 17:53
Y_Kaushik19-Dec-07 17:53 
GeneralRe: Help Needed for getting record from database Pin
Roger Broomfield19-Dec-07 18:57
Roger Broomfield19-Dec-07 18:57 
GeneralRe: Help Needed for getting record from database Pin
Y_Kaushik19-Dec-07 19:22
Y_Kaushik19-Dec-07 19:22 
GeneralRe: Help Needed for getting record from database Pin
Roger Broomfield19-Dec-07 19:41
Roger Broomfield19-Dec-07 19:41 

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.