Export (0) Print
Expand All

SHSetThreadRef function

Stores a per-thread reference to a Component Object Model (COM) object. This allows the caller to control the thread's lifetime so that it can ensure that Windows won't shut down the thread before the caller is ready.

Syntax


HRESULT SHSetThreadRef(
  _In_opt_  IUnknown *punk
);

Parameters

punk [in, optional]

Type: IUnknown*

A pointer to the IUnknown of the object for which you want to store a reference. This value can be NULL.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Use SHGetThreadRef to retrieve the IUnknown pointer.

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 5.0 or later);
ShCore.dll

See also

SHCreateThread
SHCreateThreadRef
SHGetThreadRef
SHReleaseThreadRef

 

 

Community Additions

ADD
Show:
© 2014 Microsoft