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

C / C++ / MFC

 
GeneralRe: Use pipe without WriteFile Func Pin
Member 42102520-May-04 6:32
Member 42102520-May-04 6:32 
GeneralLong Wait for a Mutex Pin
sweep12320-May-04 5:27
sweep12320-May-04 5:27 
GeneralRe: Long Wait for a Mutex Pin
valikac20-May-04 6:14
valikac20-May-04 6:14 
GeneralRe: Long Wait for a Mutex Pin
sweep12320-May-04 6:21
sweep12320-May-04 6:21 
GeneralRe: Long Wait for a Mutex Pin
valikac20-May-04 6:31
valikac20-May-04 6:31 
GeneralRe: Long Wait for a Mutex Pin
sweep12320-May-04 6:36
sweep12320-May-04 6:36 
GeneralRe: Long Wait for a Mutex Pin
valikac20-May-04 6:45
valikac20-May-04 6:45 
GeneralRe: Long Wait for a Mutex Pin
Grahamfff20-May-04 10:18
Grahamfff20-May-04 10:18 
I am now confused!

If I create the Mutex, then when I go into my routine which I WaitForSingleObject, then I wait forever. This was my query.

But if I create it each time I go into my WaitForMutex routine, I get it; i.e. my program works. See updated WaitForMutex routine.

<big>bool WaitForMutex(void)<br />
{<br />
      /* This procedure will wait for a Mutex before <br />
allowing any write access to the shared area. */<br />
<br />
m_hMutex = ::CreateMutex(NULL,FALSE,"CSLSharedMemLock");<br />
if(m_hMutex)<br />
{<br />
      if (::WaitForSingleObject(m_hMutex,INFINITE) ==    WAIT_OBJECT_0)<br />
      {<br />
         return true;<br />
     ReleaseMutex(m_hMutex);<br />
  }<br />
      return false;<br />
    	 }<br />
}</big>


My EXE uses CSLSharedMemLock for the Mutex and the libray (DLL) also uses CSLSharedMemLock as the Mutex name.
Sweep123 working from home!

grahamfff
GeneralRe: Long Wait for a Mutex Pin
Paul Ranson20-May-04 10:34
Paul Ranson20-May-04 10:34 
GeneralRe: Long Wait for a Mutex Pin
Grahamfff20-May-04 10:45
Grahamfff20-May-04 10:45 
GeneralRe: Long Wait for a Mutex Pin
Paul Ranson20-May-04 11:34
Paul Ranson20-May-04 11:34 
GeneralRe: Long Wait for a Mutex Pin
valikac20-May-04 11:24
valikac20-May-04 11:24 
GeneralBitwise Left Shift Pin
Anthony988720-May-04 5:08
Anthony988720-May-04 5:08 
GeneralRe: Bitwise Left Shift Pin
Michael Dunn20-May-04 5:13
sitebuilderMichael Dunn20-May-04 5:13 
GeneralRe: Bitwise Left Shift Pin
Antony M Kancidrowski20-May-04 5:26
Antony M Kancidrowski20-May-04 5:26 
GeneralRe: Bitwise Left Shift Pin
mirex20-May-04 21:39
mirex20-May-04 21:39 
GeneralRe: Bitwise Left Shift Pin
Antony M Kancidrowski20-May-04 5:25
Antony M Kancidrowski20-May-04 5:25 
GeneralRe: Bitwise Left Shift Pin
deniz79s20-May-04 9:01
deniz79s20-May-04 9:01 
GeneralIt is illegal to call out while inside message filter Pin
Member 53435720-May-04 4:55
Member 53435720-May-04 4:55 
GeneralRe: It is illegal to call out while inside message filter Pin
Andrew Quinn AUS20-May-04 5:14
Andrew Quinn AUS20-May-04 5:14 
GeneralRe: It is illegal to call out while inside message filter Pin
Member 53435720-May-04 6:27
Member 53435720-May-04 6:27 
QuestionHow do I form the HTTP headers to DL a .CAB file? Pin
Terry O'Nolley20-May-04 4:39
Terry O'Nolley20-May-04 4:39 
AnswerRe: How do I form the HTTP headers to DL a .CAB file? Pin
Alexander M.,20-May-04 5:26
Alexander M.,20-May-04 5:26 
GeneralRe: How do I form the HTTP headers to DL a .CAB file? Pin
Terry O'Nolley20-May-04 6:29
Terry O'Nolley20-May-04 6:29 
Generalabout MSChart Pin
yingkou20-May-04 3:16
yingkou20-May-04 3:16 

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.