본문 바로가기

Programming/MFC

Thread 강제 종료

스레드를 강제 종료한다.

 

// 헤더에 정의

// Thread Point
 static CWinThread*  m_pThreadSend ; 

 

 

// cpp에 구현

// 전역

CWinThread* CErSender::m_pThreadSend = NULL ;

 

// 스레드 시작시에 핸들을 저장

// send thread
 m_pThreadSend = NULL ;
 m_pThreadSend = AfxBeginThread( ThreadProcRTP, this ) ; 

 

// 종료 함수 내에

DWORD nExitCode = NULL ;
GetExitCodeThread( m_pThreadSend->m_hThread, &nExitCode ) ;
TerminateThread( m_pThreadSend->m_hThread, nExitCode ) ;

'Programming > MFC' 카테고리의 다른 글

Multi Line List  (0) 2006.11.03
ExplorerView  (0) 2006.11.01
TextProgress 사용하기  (0) 2006.09.27
레지스트리에 등록된 프로그램을 실행 시키기  (0) 2006.09.06
System Error Codes  (0) 2006.09.05