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

C / C++ / MFC

 
QuestionHow to get LoginNames of all Users in my Domain? Pin
narayanagvs24-Sep-08 2:05
narayanagvs24-Sep-08 2:05 
QuestionRe: How to get LoginNames of all Users in my Domain? Pin
David Crow24-Sep-08 4:11
David Crow24-Sep-08 4:11 
AnswerRe: How to get LoginNames of all Users in my Domain? Pin
Hamid_RT24-Sep-08 6:15
Hamid_RT24-Sep-08 6:15 
Questiondeletion of thread pointer Pin
ptr_Electron24-Sep-08 0:41
ptr_Electron24-Sep-08 0:41 
AnswerRe: deletion of thread pointer Pin
SandipG 24-Sep-08 0:55
SandipG 24-Sep-08 0:55 
AnswerRe: deletion of thread pointer Pin
CPallini24-Sep-08 0:59
mveCPallini24-Sep-08 0:59 
AnswerRe: deletion of thread pointer Pin
perle124-Sep-08 1:14
perle124-Sep-08 1:14 
AnswerRe: deletion of thread pointer Pin
Roger Stoltz24-Sep-08 1:51
Roger Stoltz24-Sep-08 1:51 
As the others already have said: no, you don't.
At least not in the context you provided.

But...
It's considered good practice to make sure all threads have finished before closing an application. By waiting on the thread handle you make sure the thread has finished. To be able to wait on the thread handle with e.g. ::WaitForSingleObject(), the thread handle must be valid. If the CWinThread object has its m_bAutoDelete member set to TRUE the thread handle will be closed when the thread exit its controlling function and the CWinThread object is destroyed.

If you want to avoid this situation you should create the thread suspended and set the m_bAutoDelete memeber to FALSE before resuming thread execution with a call to CWinThread::ResumeThread().
In this case you have to delete the CWinThread object yourself by calling delete after you've waited on the thread handle CWinThread::m_hThread.

Read more here[^].


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


QuestionC2668 Pin
T.RATHA KRISHNAN24-Sep-08 0:30
T.RATHA KRISHNAN24-Sep-08 0:30 
AnswerRe: C2668 Pin
toxcct24-Sep-08 0:36
toxcct24-Sep-08 0:36 
QuestionRe: C2668 Pin
T.RATHA KRISHNAN24-Sep-08 0:41
T.RATHA KRISHNAN24-Sep-08 0:41 
AnswerRe: C2668 [modified] Pin
SandipG 24-Sep-08 1:06
SandipG 24-Sep-08 1:06 
GeneralRe: C2668 Pin
T.RATHA KRISHNAN24-Sep-08 1:20
T.RATHA KRISHNAN24-Sep-08 1:20 
GeneralRe: C2668 Pin
SandipG 24-Sep-08 1:21
SandipG 24-Sep-08 1:21 
AnswerRe: C2668 Pin
toxcct24-Sep-08 4:22
toxcct24-Sep-08 4:22 
GeneralRe: C2668 [modified] Pin
SandipG 24-Sep-08 1:03
SandipG 24-Sep-08 1:03 
QuestionRe: C2668 Pin
Mahesh Kulkarni24-Sep-08 0:48
Mahesh Kulkarni24-Sep-08 0:48 
AnswerRe: C2668 Pin
toxcct24-Sep-08 0:56
toxcct24-Sep-08 0:56 
AnswerRe: C2668 Pin
SandipG 24-Sep-08 0:57
SandipG 24-Sep-08 0:57 
AnswerRe: C2668 Pin
sashoalm24-Sep-08 1:01
sashoalm24-Sep-08 1:01 
GeneralRe: C2668 Pin
T.RATHA KRISHNAN24-Sep-08 1:18
T.RATHA KRISHNAN24-Sep-08 1:18 
QuestionRe: C2668 Pin
Matthew Faithfull24-Sep-08 1:36
Matthew Faithfull24-Sep-08 1:36 
AnswerRe: C2668 Pin
SandipG 24-Sep-08 1:45
SandipG 24-Sep-08 1:45 
QuestionDebugging issue to watch variable values Pin
George_George24-Sep-08 0:03
George_George24-Sep-08 0:03 
AnswerRe: Debugging issue to watch variable values [modified] Pin
kapardhi24-Sep-08 1:36
kapardhi24-Sep-08 1:36 

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.