description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CRTThreadTraits Class |
CRTThreadTraits Class |
11/04/2016 |
|
|
eb6e20b0-c2aa-4170-8e34-aaeeacc86343 |
This class provides the creation function for a CRT thread. Use this class if the thread will use CRT functions.
Important
This class and its members cannot be used in applications that execute in the Windows Runtime.
class CRTThreadTraits
Name | Description |
---|---|
CRTThreadTraits::CreateThread | (Static) Call this function to create a thread that can use CRT functions. |
Thread traits are classes that provide a creation function for a particular type of thread. The creation function has the same signature and semantics as the Windows CreateThread function.
Thread traits are used by the following classes:
If the thread will not be using CRT functions, use Win32ThreadTraits instead.
Header: atlbase.h
Call this function to create a thread that can use CRT functions.
static HANDLE CreateThread(
LPSECURITY_ATTRIBUTES lpsa,
DWORD dwStackSize,
LPTHREAD_START_ROUTINE pfnThreadProc,
void* pvParam,
DWORD dwCreationFlags,
DWORD* pdwThreadId) throw();
lpsa
The security attributes for the new thread.
dwStackSize
The stack size for the new thread.
pfnThreadProc
The thread procedure of the new thread.
pvParam
The parameter to be passed to the thread procedure.
dwCreationFlags
The creation flags (0 or CREATE_SUSPENDED).
pdwThreadId
[out] Address of the DWORD variable that, on success, receives the thread ID of the newly created thread.
Returns the handle to the newly created thread or NULL on failure. Call GetLastError to get extended error information.
See CreateThread for further information on the parameters to this function.
This function calls _beginthreadex to create the thread.