hi Everybody, I am using postquitmessage(GetIndexThread(<thraedname>,
NULL)) function to terminate the thread just below the calling
function.

UINT CHRS_MoleDlg::Thread_Camera(LPVOID param)
{
CHRS_MoleDlg *self=(CHRS_MoleDlg *)param;
for(;;)
self->OnCameraThread();
PostQuitMessage(GetExitCodeThread(Thread_Camera , NULL));
return 0;
}

but still i am facing problem , actually i dont know exactly where i
should write postquitmessage() what function i should used to terminate
thraed.
please tell me.

Re: function to terminate worker thread in VC++ by Alexander

Alexander
Sun Nov 27 00:15:29 CST 2005

PostQiotMessage allows a message loop to break.
You have an infinite loop in your thread, which will never end.

To end a thread, simply return from it.
To let the thread know it whould end, use an event (unnamed, of course).

<raghunandan_1081@yahoo.com> wrote in message
news:1132927499.479143.72560@f14g2000cwb.googlegroups.com...
> hi Everybody, I am using postquitmessage(GetIndexThread(<thraedname>,
> NULL)) function to terminate the thread just below the calling
> function.
>
> UINT CHRS_MoleDlg::Thread_Camera(LPVOID param)
> {
> CHRS_MoleDlg *self=(CHRS_MoleDlg *)param;
> for(;;)
> self->OnCameraThread();
> PostQuitMessage(GetExitCodeThread(Thread_Camera , NULL));
> return 0;
> }
>
> but still i am facing problem , actually i dont know exactly where i
> should write postquitmessage() what function i should used to terminate
> thraed.
> please tell me.
>