+ Reply to Thread
Results 1 to 2 of 2

Thread: How to end a thread using WIN32?

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    24

    How to end a thread using WIN32?

    How can I end a thread after I created it using _beginthread in WIN32 application? what needs to be done to end a thread.

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    20
    Code:
    void ThreadFunc(void *pParam)
    {
    	_endthread() ;//this will end a thread and close its handle!
    }
    
    BOOL CDlg::OnInitDialog()
    {
    	CDialog::OnInitDialog();
    	_beginthread(ThreadFunc, 0, NULL) ;
    	return TRUE;
    }
    You can use "_endthread" function to end a thread as shown in above example.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts