Click here to Skip to main content
15,883,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to update a string in C++ MFC CListBox Pin
led mike25-Jun-09 4:33
led mike25-Jun-09 4:33 
AnswerRe: How to update a string in C++ MFC CListBox Pin
CodeMacDaddy26-Jun-09 8:41
CodeMacDaddy26-Jun-09 8:41 
QuestionRe: How to update a string in C++ MFC CListBox Pin
David Crow25-Jun-09 5:30
David Crow25-Jun-09 5:30 
AnswerRe: How to update a string in C++ MFC CListBox Pin
Rajesh R Subramanian25-Jun-09 7:17
professionalRajesh R Subramanian25-Jun-09 7:17 
AnswerRe: How to update a string in C++ MFC CListBox Pin
Maximilien25-Jun-09 7:21
Maximilien25-Jun-09 7:21 
QuestionDifferent mutex handle even though it was created already? Pin
Souldrift25-Jun-09 3:48
Souldrift25-Jun-09 3:48 
AnswerRe: Different mutex handle even though it was created already? Pin
led mike25-Jun-09 4:29
led mike25-Jun-09 4:29 
AnswerRe: Different mutex handle even though it was created already? Pin
Joe Woodbury25-Jun-09 8:33
professionalJoe Woodbury25-Jun-09 8:33 
The main problem here is that you are returning a local variable. In addition, every time your function is called, it creates a new mutex handle (referencing the same mutex.) You are leaking handles like crazy.

To properly use a mutex you need to first create it (and you don't need to do a conversion from a char to wide string--just call CreateMutexA.) The locking is done separately.

BTW, only use mutexes if you are synchronizing between processes or you have to have multiple waits on a lock, otherwise use critical sections.


Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke


AnswerRe: Different mutex handle even though it was created already? Pin
norish25-Jun-09 20:14
norish25-Jun-09 20:14 
QuestionHow to change the background color of an EditBox Pin
Deepu Antony25-Jun-09 3:34
Deepu Antony25-Jun-09 3:34 
AnswerRe: How to change the background color of an EditBox Pin
David Crow25-Jun-09 3:41
David Crow25-Jun-09 3:41 
GeneralRe: How to change the background color of an EditBox Pin
Deepu Antony25-Jun-09 4:12
Deepu Antony25-Jun-09 4:12 
QuestionFile Explorer Properties in MFC/Vista Pin
Software200725-Jun-09 3:16
Software200725-Jun-09 3:16 
QuestionB/B+ tree template Pin
alikalik25-Jun-09 3:03
alikalik25-Jun-09 3:03 
AnswerRe: B/B+ tree template Pin
Rajesh R Subramanian25-Jun-09 3:06
professionalRajesh R Subramanian25-Jun-09 3:06 
AnswerRe: B/B+ tree template Pin
CPallini25-Jun-09 3:10
mveCPallini25-Jun-09 3:10 
QuestionHow to manually implement ID_FILE_NEW for MDI application? Pin
transoft25-Jun-09 2:26
transoft25-Jun-09 2:26 
QuestionRe: How to manually implement ID_FILE_NEW for MDI application? Pin
David Crow25-Jun-09 3:44
David Crow25-Jun-09 3:44 
AnswerRe: How to manually implement ID_FILE_NEW for MDI application? Pin
transoft25-Jun-09 6:39
transoft25-Jun-09 6:39 
AnswerRe: How to manually implement ID_FILE_NEW for MDI application? Pin
David Crow25-Jun-09 7:17
David Crow25-Jun-09 7:17 
GeneralRe: How to manually implement ID_FILE_NEW for MDI application? Pin
transoft25-Jun-09 7:42
transoft25-Jun-09 7:42 
QuestionRe: How to manually implement ID_FILE_NEW for MDI application? Pin
David Crow25-Jun-09 7:45
David Crow25-Jun-09 7:45 
AnswerRe: How to manually implement ID_FILE_NEW for MDI application? Pin
transoft25-Jun-09 8:29
transoft25-Jun-09 8:29 
QuestionRe: How to manually implement ID_FILE_NEW for MDI application? Pin
David Crow25-Jun-09 8:33
David Crow25-Jun-09 8:33 
AnswerRe: How to manually implement ID_FILE_NEW for MDI application? Pin
transoft25-Jun-09 8:54
transoft25-Jun-09 8:54 

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.