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

C / C++ / MFC

 
AnswerRe: CListCtrl Pin
Jijo.Raj18-Aug-08 21:48
Jijo.Raj18-Aug-08 21:48 
AnswerRe: CListCtrl Pin
Hamid_RT19-Aug-08 3:53
Hamid_RT19-Aug-08 3:53 
QuestionI started the thread and want to wait until the thread completes [modified] Pin
ptr_Electron18-Aug-08 20:28
ptr_Electron18-Aug-08 20:28 
AnswerRe: I started the thread and want to wait until the thread completes [modified] Pin
SandipG 18-Aug-08 20:40
SandipG 18-Aug-08 20:40 
GeneralRe: I started the thread and want to wait until the thread completes Pin
ptr_Electron18-Aug-08 20:42
ptr_Electron18-Aug-08 20:42 
GeneralRe: I started the thread and want to wait until the thread completes [modified] Pin
SandipG 18-Aug-08 20:45
SandipG 18-Aug-08 20:45 
AnswerRe: I started the thread and want to wait until the thread completes Pin
Stephen Hewitt18-Aug-08 21:07
Stephen Hewitt18-Aug-08 21:07 
AnswerRe: I started the thread and want to wait until the thread completes Pin
Roger Stoltz18-Aug-08 22:33
Roger Stoltz18-Aug-08 22:33 
::AfxBeginThread() does not return a handle that can be used for waiting. It returns a pointer to a CWinThread object.

ptr_Electron wrote:
but dosn't wait for the thread to complete


If you would have bothered to check the return value from ::WaitForSingleObject() you would have found that the operation failed. A call to ::GetLastError() would most likely return ERROR_INVALID_HANDLE. To omit the validation of the return value is just sloppy.

A few days ago you had almost the same question regarding the same problem, which I replied to here[^].
I suggested an article that would explain all this and teach you how to do it the right way. If you would have bothered to read the article, this question would not have been necessary. I can see that you now use ::AfxBeginThread() instead of ::_beginthreadex(), but that's not enough.
Read the article here[^].


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


QuestionRe: I started the thread and want to wait until the thread completes Pin
Mark Salsbery19-Aug-08 8:01
Mark Salsbery19-Aug-08 8:01 
QuestionUsing DotNET API in MFC application Pin
ComplexLifeForm18-Aug-08 20:04
ComplexLifeForm18-Aug-08 20:04 
AnswerRe: Using DotNET API in MFC application Pin
Rajesh R Subramanian18-Aug-08 20:09
professionalRajesh R Subramanian18-Aug-08 20:09 
AnswerRe: Using DotNET API in MFC application Pin
Hamid_RT18-Aug-08 20:19
Hamid_RT18-Aug-08 20:19 
QuestionRemote Procedure Call. Pin
T.RATHA KRISHNAN18-Aug-08 19:48
T.RATHA KRISHNAN18-Aug-08 19:48 
AnswerRe: Remote Procedure Call. Pin
User 21559718-Aug-08 19:55
User 21559718-Aug-08 19:55 
QuestionRe: Remote Procedure Call. Pin
T.RATHA KRISHNAN18-Aug-08 20:01
T.RATHA KRISHNAN18-Aug-08 20:01 
AnswerRe: Remote Procedure Call. Pin
Rajesh R Subramanian18-Aug-08 20:05
professionalRajesh R Subramanian18-Aug-08 20:05 
AnswerRe: Remote Procedure Call. Pin
toxcct19-Aug-08 23:46
toxcct19-Aug-08 23:46 
AnswerRe: Remote Procedure Call. Pin
_AnsHUMAN_ 18-Aug-08 20:04
_AnsHUMAN_ 18-Aug-08 20:04 
AnswerRe: Remote Procedure Call. Pin
Rajesh R Subramanian18-Aug-08 20:04
professionalRajesh R Subramanian18-Aug-08 20:04 
AnswerRe: Remote Procedure Call. Pin
David Crow19-Aug-08 3:36
David Crow19-Aug-08 3:36 
Questionerror C2011 Pin
vcprog18-Aug-08 19:08
vcprog18-Aug-08 19:08 
AnswerRe: error C2011 Pin
Jijo.Raj18-Aug-08 19:44
Jijo.Raj18-Aug-08 19:44 
GeneralRe: error C2011 Pin
vcprog18-Aug-08 20:06
vcprog18-Aug-08 20:06 
GeneralRe: error C2011 Pin
Jijo.Raj18-Aug-08 21:42
Jijo.Raj18-Aug-08 21:42 
GeneralRe: error C2011 Pin
vcprog18-Aug-08 22:23
vcprog18-Aug-08 22:23 

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.