Click here to Skip to main content
16,006,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCMemFile Buffer size?? Pin
P_JAYAPRAKASH4-Jun-04 4:32
P_JAYAPRAKASH4-Jun-04 4:32 
GeneralSecure Connection between Mysql Server and C++ Client Pin
Alex H 19834-Jun-04 4:26
Alex H 19834-Jun-04 4:26 
GeneralRe: Secure Connection between Mysql Server and C++ Client Pin
markkuk4-Jun-04 6:24
markkuk4-Jun-04 6:24 
GeneralSpin Control and SetBase(16) question Pin
Like2Byte4-Jun-04 4:26
Like2Byte4-Jun-04 4:26 
QuestionOrphaned mutexes--how to release? Pin
dandy724-Jun-04 4:20
dandy724-Jun-04 4:20 
AnswerRe: Orphaned mutexes--how to release? Pin
bikram singh4-Jun-04 7:11
bikram singh4-Jun-04 7:11 
GeneralRe: Orphaned mutexes--how to release? Pin
dandy724-Jun-04 8:36
dandy724-Jun-04 8:36 
GeneralRe: Orphaned mutexes--how to release? Pin
Blake Miller4-Jun-04 14:05
Blake Miller4-Jun-04 14:05 
No, but another thing you can try is to OPEN the mutex in your app, and if that fails, CREATE it.

If you can OPEN the mutex, you might try to wait on it for a very short while, and if you can, then you own it, and you do not have to 'release' it until your app quits or dies.

Now, if you open it and try to aquire the mutex, but you get MUTEX_ABANDONED return result, your previous instance is gone, even though the mutex still exists.
If you try to aquire it and get WAIT_FAILED, then something else still has hold of the mutex (probably another instance of your app). You can choose to wait a few seconds (if you are allowed) and try again, in case other instance is in process of shutting down.

By the way, you might want to also consider Josehp NEwcomer's dialog on the mutexes, because how you name it can have sever impact on muiutple isntances fo your progrma under terminal services and Widnows XP. You REALLY have to be careful to determine exactly what you want.

Anyhow, trying to aquire the mutex as well as open or create it might be better long run, in case another process, like a diagnostic tool, has a handle open to the mutex, but is not necessarily indicative of your specific process running (it should be unlikely an unknown application will attempt to aquire your mutex).

You TOTALLY must read this first...
http://www.flounder.com/nomultiples.htm

GeneralRe: Orphaned mutexes--how to release? Pin
dandy727-Jun-04 7:40
dandy727-Jun-04 7:40 
QuestionHow to use CInternetFile::WriteString() Pin
brdavid4-Jun-04 4:13
brdavid4-Jun-04 4:13 
Questionhow to use control in a dialog Pin
laia4-Jun-04 3:20
laia4-Jun-04 3:20 
AnswerRe: how to use control in a dialog Pin
toxcct4-Jun-04 5:54
toxcct4-Jun-04 5:54 
GeneralRe: how to use control in a dialog Pin
laia4-Jun-04 6:15
laia4-Jun-04 6:15 
GeneralSetWindowLong Returns negative Value. Pin
Abhi Lahare4-Jun-04 2:56
Abhi Lahare4-Jun-04 2:56 
GeneralRe: SetWindowLong Returns negative Value. Pin
toxcct4-Jun-04 3:05
toxcct4-Jun-04 3:05 
QuestionHow to get record from a table in Access Pin
yingkou4-Jun-04 1:51
yingkou4-Jun-04 1:51 
GeneralConvert MDI to SDI application Pin
Salvador Dali4-Jun-04 0:52
Salvador Dali4-Jun-04 0:52 
GeneralRe: Convert MDI to SDI application Pin
Johan Rosengren4-Jun-04 3:27
Johan Rosengren4-Jun-04 3:27 
GeneralRe: Convert MDI to SDI application Pin
Salvador Dali4-Jun-04 3:56
Salvador Dali4-Jun-04 3:56 
GeneralRe: Convert MDI to SDI application Pin
Johan Rosengren4-Jun-04 5:07
Johan Rosengren4-Jun-04 5:07 
General[Q] layered image application Pin
Choi Wanho4-Jun-04 0:46
Choi Wanho4-Jun-04 0:46 
GeneralRe: [Q] layered image application Pin
basementman4-Jun-04 6:04
basementman4-Jun-04 6:04 
QuestionHow to use MFC classes in WinAPI app Pin
lapenkov3-Jun-04 23:46
lapenkov3-Jun-04 23:46 
AnswerRe: How to use MFC classes in WinAPI app Pin
toxcct3-Jun-04 23:49
toxcct3-Jun-04 23:49 
AnswerRe: How to use MFC classes in WinAPI app Pin
Diddy3-Jun-04 23:50
Diddy3-Jun-04 23:50 

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.