Click here to Skip to main content
15,893,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: Different mutex handle even though it was created already? Pin
norish25-Jun-09 20:14
norish25-Jun-09 20:14 
It is not important the handle value of CreateMutex are different or same becuase the handle will never be compared its value but only be used with WaitForXXXXXX function.
Others wrote that mutex can not lock with the same thread and this implementation may cause handle leaks.
I suggest another locking mechanism using InterlockedIncrement and InterlockedDecrement like;
extern long some_locker = 0;

bool lock(long& name) {
  if (1 == InterlockedIncrement(&name))
    return true;
  InterlockedDecrement(&name);
  return false;
}

void unlock(long& name) {
  InterlockedDecremtn(&name);
}

Note that this implementation dose not wait, so you must write wait loop for this for example;
while (!lock(some_locker)) Sleep(10);
// ... some task
unlock(some_locker);

This may not be quite your requirement, but one way of some practical technique.
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 
QuestionRe: How to manually implement ID_FILE_NEW for MDI application? Pin
David Crow25-Jun-09 9:05
David Crow25-Jun-09 9:05 

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.