description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||
---|---|---|---|---|---|---|---|---|---|---|
Learn more about: IWorkerThreadClient Interface |
IWorkerThreadClient Interface |
11/04/2016 |
|
|
56f4a2f5-007e-4a33-9e20-05187629f715 |
IWorkerThreadClient
is the interface implemented by clients of the CWorkerThread class.
Important
This class and its members cannot be used in applications that execute in the Windows Runtime.
__interface IWorkerThreadClient
Name | Description |
---|---|
CloseHandle | Implement this method to close the handle associated with this object. |
Execute | Implement this method to execute code when the handle associated with this object becomes signaled. |
Implement this interface when you have code that needs to execute on a worker thread in response to a handle becoming signaled.
Header: atlutil.h
Implement this method to close the handle associated with this object.
HRESULT CloseHandle(HANDLE hHandle);
hHandle
The handle to be closed.
Return S_OK on success, or an error HRESULT on failure.
The handle passed to this method was previously associated with this object by a call to CWorkerThread::AddHandle.
The following code shows a simple implementation of IWorkerThreadClient::CloseHandle
.
[!code-cppNVC_ATL_Utilities#135]
Implement this method to execute code when the handle associated with this object becomes signaled.
HRESULT Execute(DWORD_PTR dwParam, HANDLE hObject);
dwParam
The user parameter.
hObject
The handle that has become signaled.
Return S_OK on success, or an error HRESULT on failure.
The handle and DWORD/pointer passed to this method were previously associated with this object by a call to CWorkerThread::AddHandle.
The following code shows a simple implementation of IWorkerThreadClient::Execute
.
[!code-cppNVC_ATL_Utilities#136]