Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: using enum in #if preprocessor directive Pin
Taran919-May-09 0:51
Taran919-May-09 0:51 
GeneralRe: using enum in #if preprocessor directive Pin
Rajesh R Subramanian19-May-09 0:30
professionalRajesh R Subramanian19-May-09 0:30 
AnswerRe: using enum in #if preprocessor directive Pin
Perisic, Aleksandar18-May-09 23:50
Perisic, Aleksandar18-May-09 23:50 
GeneralRe: using enum in #if preprocessor directive Pin
Priya_Sundar19-May-09 0:11
Priya_Sundar19-May-09 0:11 
Questionbackground image for toolbar base on dialog Pin
yiyinkuang18-May-09 22:15
yiyinkuang18-May-09 22:15 
AnswerRe: background image for toolbar base on dialog Pin
_AnsHUMAN_ 18-May-09 23:11
_AnsHUMAN_ 18-May-09 23:11 
GeneralRe: background image for toolbar base on dialog Pin
yiyinkuang18-May-09 23:28
yiyinkuang18-May-09 23:28 
GeneralRe: background image for toolbar base on dialog Pin
_AnsHUMAN_ 19-May-09 0:33
_AnsHUMAN_ 19-May-09 0:33 
GeneralRe: background image for toolbar base on dialog Pin
yiyinkuang19-May-09 15:22
yiyinkuang19-May-09 15:22 
Questioncontrolling system volume by vc++ Pin
B060611518-May-09 22:11
B060611518-May-09 22:11 
AnswerRe: controlling system volume by vc++ Pin
Chandrasekharan P18-May-09 22:36
Chandrasekharan P18-May-09 22:36 
QuestionRe: controlling system volume by vc++ Pin
David Crow19-May-09 5:01
David Crow19-May-09 5:01 
AnswerRe: controlling system volume by vc++ Pin
B060611519-May-09 23:46
B060611519-May-09 23:46 
QuestionCreating a column with bitmaps on CListCtrl residing on a dialog Pin
JJeffrey18-May-09 21:37
JJeffrey18-May-09 21:37 
AnswerRe: Creating a column with bitmaps on CListCtrl residing on a dialog Pin
Stuart Dootson18-May-09 22:49
professionalStuart Dootson18-May-09 22:49 
GeneralRe: Creating a column with bitmaps on CListCtrl residing on a dialog Pin
JJeffrey18-May-09 23:21
JJeffrey18-May-09 23:21 
GeneralRe: Creating a column with bitmaps on CListCtrl residing on a dialog Pin
Stuart Dootson19-May-09 0:34
professionalStuart Dootson19-May-09 0:34 
GeneralRe: Creating a column with bitmaps on CListCtrl residing on a dialog Pin
JJeffrey19-May-09 23:26
JJeffrey19-May-09 23:26 
QuestionPure win32 cross-process child windows Pin
megaadam18-May-09 21:36
professionalmegaadam18-May-09 21:36 
Answer[Message Deleted] Pin
Perisic, Aleksandar18-May-09 23:59
Perisic, Aleksandar18-May-09 23:59 
General[Message Deleted] Pin
megaadam19-May-09 1:01
professionalmegaadam19-May-09 1:01 
General[Message Deleted] Pin
Perisic, Aleksandar19-May-09 1:42
Perisic, Aleksandar19-May-09 1:42 
QuestionClosing an MDI child window having a worker thread in execution Pin
CString(0xcccccccc)18-May-09 21:29
CString(0xcccccccc)18-May-09 21:29 
AnswerRe: Closing an MDI child window having a worker thread in execution Pin
Stuart Dootson18-May-09 22:57
professionalStuart Dootson18-May-09 22:57 
CString(0xcccccccc) wrote:
Normally I set the bThreadMustStop to TRUE, then enter a loop waiting for bThreadStopped to become TRUE

Don't. Set bThreadMustStop to TRUE with InterlockedExchange[^], then wait for the thread to exit using <a href="http://msdn.microsoft.com/en-us/library/ms687032.aspx" rel="nofollow">WaitForSingleObject</a>[^], like this:
// Assume thread handle is in the variable hThread
InterlockedExchange((LONG*)&bThreadMustStop, (LONG)TRUE);
WaitForSingleObject(hThread, INFINITE); // Or whatever time-out is valid
The <a href="http://msdn.microsoft.com/en-us/library/ms687032.aspx" rel="nofollow">WaitForSingleObject</a> yields control to the kernel, allowing the thread to get some processor time, so it can read the flag and then exit. The act of the thread exiting will cause the thread handle to enter a signalled state, terminating the <a href="http://msdn.microsoft.com/en-us/library/ms687032.aspx" rel="nofollow">WaitForSingleObject</a> call.



QuestionCheck file is open or not Pin
Davitor18-May-09 20:50
Davitor18-May-09 20: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.