Microsoft Speech SDK
SAPI 5.1
ISpTaskManager::CreateThreadControl
ISpTaskManager::CreateThreadControl allocates a thread control object and does not allocate a thread.
HRESULT CreateThreadControl(
ISpThreadTask *pTask,
void *pvTaskData,
long nPriority,
ISpThreadControl **ppThreadCtrl
);
Parameters
- pTask
- [in] Address of the ISpThreadTask interface that is used to initialize and execute the task thread.
- pvTaskData
- [in] Data passed to all ISpThreadTask member functions. This value can be NULL.
- nPriority
- [in] The Win32 priority for the allocated thread.
- ppThreadCtrl
- [out] Address of a pointer to an ISpThreadControl interface that receives the thread control.
Return values
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | pTask is invalid or bad. |
E_POINTER | ppThreadCtrl is invalid or bad. |
E_OUTOFMEMORY | Exceeded available memory. |
FAILED (hr) | Appropriate error message. |