From: Ganga, Venkatesh [VG200005@exchange.SanDiegoCA.NCR.COM] Sent: Tuesday, June 29, 1999 7:19 PM To: ntdev@atria.com Subject: RE: [ntdev] How can I terminate a thread created by _beginthread( ) If a thread x has to exit by itself it will call _endthread(). _endthread() does not have any parameter for specifying the thread identifier. whereas a TerminateThread() has got one. If a thead x has to kill or terminate a thread y then x will call TerminateThread(handle of thread y) Equivalent of _endthread() is ExitThread() which are both clean ways to exit. Where as TerminateThread will not notify the DLLs attached to the process which prohibit the DLL_THREAD_DETACH to be called for all the DLLs. I think TerminateThread() can also be used for threads created by the _beginthread(). Because anyway cleanup code will not be called. But _endthread() is clean way for a thread to exit which was created by the _beginthread() because it will be executing some cleanup code in the C Run time libraries. -----Original Message----- From: Paul Bunn [SMTP:paul@ultrabac.com] Sent: Tuesday, June 29, 1999 12:33 PM To: 'Chen, Mike (*Anaheim)'; ntdev@atria.com Subject: RE: [ntdev] How can I terminate a thread created by _beginthread( ) use _beginthreadex() which predicates using _endthreadex() Regards, Paul Bunn, UltraBac.Com, 425-644-6000 Microsoft MVP - WindowsNT http://www.ultrabac.com -----Original Message----- From: Chen, Mike (*Anaheim) [mailto:MikeChen@FBCS.Fujitsu.com] Sent: Tuesday, June 29, 1999 11:00 AM To: ntdev@atria.com Subject: [ntdev] How can I terminate a thread created by _beginthread() Hi, I am using VC++6.0 on NT4.0. I need to terminate a thread which is created by _beginthread(). I know if I call CreateThread(), I can get a thread handle in type of HANDLE, then I can call TerminateThread() to terminate it. But how can I do the same thing with _beginthread() ? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]