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

C / C++ / MFC

 
GeneralRe: Help with global variable in MFC dialog application Pin
CPallini19-Oct-09 3:02
mveCPallini19-Oct-09 3:02 
GeneralRe: Help with global variable in MFC dialog application Pin
moh.hijjawi19-Oct-09 5:30
moh.hijjawi19-Oct-09 5:30 
GeneralRe: Help with global variable in MFC dialog application Pin
CPallini19-Oct-09 8:04
mveCPallini19-Oct-09 8:04 
GeneralRe: Help with global variable in MFC dialog application Pin
moh.hijjawi30-Oct-09 2:52
moh.hijjawi30-Oct-09 2:52 
QuestionMutexes and WaitForSingleObject -> doesn´t wait ?? Pin
Souldrift19-Oct-09 0:41
Souldrift19-Oct-09 0:41 
AnswerRe: Mutexes and WaitForSingleObject -> doesn´t wait ?? Pin
Michael Schubert19-Oct-09 0:53
Michael Schubert19-Oct-09 0:53 
GeneralRe: Mutexes and WaitForSingleObject -> doesn´t wait ?? Pin
Souldrift19-Oct-09 0:56
Souldrift19-Oct-09 0:56 
AnswerRe: Mutexes and WaitForSingleObject -> doesn´t wait ?? Pin
CPallini19-Oct-09 0:58
mveCPallini19-Oct-09 0:58 
Souldrift wrote:
No I don´t understand why the second WaitForSingleObject()-call doesn´t block. Since I said to wait indefinitely, shouldn´t it do so because the mutex object is already in use?


Souldrift wrote:
I guess, I have some general trouble understanding the mechanism here.


You're missing this ([^])
The thread that owns a mutex can specify the same mutex in repeated wait function calls without blocking its execution. Typically, you would not wait repeatedly for the same mutex, but this mechanism prevents a thread from deadlocking itself while waiting for a mutex that it already owns. However, to release its ownership, the thread must call ReleaseMutex once for each time that the mutex satisfied a wait.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: Mutexes and WaitForSingleObject -> doesn´t wait ?? Pin
Souldrift19-Oct-09 1:14
Souldrift19-Oct-09 1:14 
QuestionWindows API flag to specifically remove taskbar button Pin
Nicola Curran18-Oct-09 22:50
Nicola Curran18-Oct-09 22:50 
AnswerRe: Windows API flag to specifically remove taskbar button Pin
Nicola Curran18-Oct-09 23:42
Nicola Curran18-Oct-09 23:42 
GeneralRe: Windows API flag to specifically remove taskbar button Pin
Rozis19-Oct-09 10:05
Rozis19-Oct-09 10:05 
GeneralRe: Windows API flag to specifically remove taskbar button Pin
Nicola Curran19-Oct-09 21:49
Nicola Curran19-Oct-09 21:49 
QuestionHow to prevent other from accessing to the files when program running Pin
Nicholas Amh18-Oct-09 22:27
Nicholas Amh18-Oct-09 22:27 
AnswerRe: How to prevent other from accessing to the files when program running Pin
Adam Roderick J18-Oct-09 22:38
Adam Roderick J18-Oct-09 22:38 
GeneralRe: How to prevent other from accessing to the files when program running Pin
Nicholas Amh18-Oct-09 22:41
Nicholas Amh18-Oct-09 22:41 
GeneralRe: How to prevent other from accessing to the files when program running Pin
Nicholas Amh18-Oct-09 22:57
Nicholas Amh18-Oct-09 22:57 
GeneralRe: How to prevent other from accessing to the files when program running, Pin
Adam Roderick J18-Oct-09 23:13
Adam Roderick J18-Oct-09 23:13 
GeneralRe: How to prevent other from accessing to the files when program running, Pin
Nicholas Amh18-Oct-09 23:30
Nicholas Amh18-Oct-09 23:30 
GeneralRe: How to prevent other from accessing to the files when program running, Pin
Nicholas Amh18-Oct-09 23:34
Nicholas Amh18-Oct-09 23:34 
GeneralRe: How to prevent other from accessing to the files when program running, Pin
Richard MacCutchan18-Oct-09 23:51
mveRichard MacCutchan18-Oct-09 23:51 
GeneralRe: How to prevent other from accessing to the files when program running, Pin
Adam Roderick J19-Oct-09 0:03
Adam Roderick J19-Oct-09 0:03 
QuestionTreeCntrl and ListCntrl Pin
ratprita18-Oct-09 22:11
ratprita18-Oct-09 22:11 
AnswerRe: TreeCntrl and ListCntrl Pin
CPallini18-Oct-09 22:33
mveCPallini18-Oct-09 22:33 
GeneralRe: TreeCntrl and ListCntrl Pin
ratprita18-Oct-09 22:39
ratprita18-Oct-09 22:39 

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.