Click here to Skip to main content
15,879,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: In System Tray Icon Ballon not displayed in Windows XP. Pin
«_Superman_»16-Sep-09 1:21
professional«_Superman_»16-Sep-09 1:21 
QuestionWaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Chesnokov Yuriy16-Sep-09 0:33
professionalChesnokov Yuriy16-Sep-09 0:33 
AnswerRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
«_Superman_»16-Sep-09 1:18
professional«_Superman_»16-Sep-09 1:18 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Chesnokov Yuriy16-Sep-09 1:51
professionalChesnokov Yuriy16-Sep-09 1:51 
AnswerRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 1:29
professional Randor 16-Sep-09 1:29 
AnswerRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Chesnokov Yuriy16-Sep-09 1:51
professionalChesnokov Yuriy16-Sep-09 1:51 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 2:29
professional Randor 16-Sep-09 2:29 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 2:55
Roger Stoltz16-Sep-09 2:55 
Randor wrote:
1.) Create your thread suspended.
2.) Duplicate the thread handle.
3.) Wait on the duplicated handle.
4.) Resume the thread.


Better to create the thread suspended, set the CWinThread::m_bAutoDelete to FALSE and then resume the execution of the thread.
The CWinThread object will normally destroy itself when the thread exits and consequently close the thread handle. This is prevented by setting m_bAutoDelete to FALSE.
But it also means that the caller is responsible for deleting the CWinThread object when the thread has finished.

As always: more info here[^].


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 3:08
professional Randor 16-Sep-09 3:08 
AnswerRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 4:07
Roger Stoltz16-Sep-09 4:07 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 4:40
professional Randor 16-Sep-09 4:40 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 5:34
Roger Stoltz16-Sep-09 5:34 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 7:04
professional Randor 16-Sep-09 7:04 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Chesnokov Yuriy16-Sep-09 7:22
professionalChesnokov Yuriy16-Sep-09 7:22 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 7:47
professional Randor 16-Sep-09 7:47 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 7:59
Roger Stoltz16-Sep-09 7:59 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 8:51
professional Randor 16-Sep-09 8:51 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 11:58
Roger Stoltz16-Sep-09 11:58 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 12:25
professional Randor 16-Sep-09 12:25 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 12:51
Roger Stoltz16-Sep-09 12:51 
AnswerRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Stuart Dootson16-Sep-09 1:58
professionalStuart Dootson16-Sep-09 1:58 
AnswerRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Jeff Archer16-Sep-09 2:47
Jeff Archer16-Sep-09 2:47 
QuestionExiting an MFC ActiveX Pin
Opa Knack15-Sep-09 22:41
Opa Knack15-Sep-09 22:41 
AnswerRe: Exiting an MFC ActiveX Pin
Stuart Dootson16-Sep-09 0:28
professionalStuart Dootson16-Sep-09 0:28 
AnswerRe: Exiting an MFC ActiveX Pin
Roger Stoltz16-Sep-09 0:38
Roger Stoltz16-Sep-09 0:38 

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.