Share via


ISpThreadControl::WaitForThreadDone

This method requests a thread to stop running, waits until the thread stops running, or both. Setting fForceStop to TRUE with a timeout of zero simply requests the thread to exit, and allows the method to return immediately. The caller can then wait for a ThreadCompleteEvent using a Win32 wait function.

HRESULT WaitForThreadDone(
  BOOL fForceStop,
  HRESULT* phrThreadResult,
  ULONG msTimeOut
);

Parameters

  • fForceStop
    [in] Value indicating if the method is to stop thread processing. Set this value to TRUE to stop processing, and to FALSE otherwise. If processing is to be stopped, the ISpThreadTask::ThreadProc method is called with hExitThreadEvent set and pfContinueProcessing set to FALSE for the worker thread.
  • phrThreadResult
    [out] Pointer to the value returned from ISpThreadTask::ThreadProc function if WaitForThreadDone returns S_OK.
  • msTimeOut
    [in] Timeout interval, in milliseconds, to wait before timing out the wait operation.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG One or more arguments are invalid.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sapiddk.h, Sapiddk.idl.
Link Library: Sapilib.lib.

See Also

ISpThreadControl | SAPI Interfaces

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.