다음을 통해 공유


AfxGetThread

Call this function to get a pointer to the CWinThread object representing the currently executing thread.

CWinThread* AfxGetThread( );

반환 값

Pointer to the currently executing thread; otherwise NULL.

설명

Must be called from within the desired thread.

참고

If you are porting an MFC project calling AfxGetThread from Visual C++ versions 4.2, 5.0, or 6.0, AfxGetThread calls AfxGetApp if no thread is found.In Visual C+ .NET and later, AfxGetThread returns NULL if no thread was found.If you want the application thread, you must call AfxGetApp.

예제

//Print the current thread ID in the Debug Window
TRACE(_T("Current Thread ID = 0x%X\n"), AfxGetThread()->m_nThreadID);

요구 사항

헤더: afxwin.h

참고 항목

참조

AfxBeginThread

개념

MFC 매크로 및 전역