Export (0) Print
Expand All

SHCreateThreadRef function

Creates a per-thread reference to a Component Object Model (COM) object.

Syntax


HRESULT SHCreateThreadRef(
  _In_   LONG *pcRef,
  _Out_  IUnknown **ppunk
);

Parameters

pcRef [in]

Type: LONG*

A pointer to a value, usually a local variable in the thread's ThreadProc, that is used by the interface in ppunk as a reference counter.

ppunk [out]

Type: IUnknown**

The address of a pointer to an IUnknown interface. If successful, this parameter holds the thread's IUnknown pointer on return. Your application is responsible for freeing the pointer when it is finished.

Return value

Type: HRESULT

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

Remarks

See Managing Thread References for more details on using the Shlwapi thread APIs.

Requirements

Minimum supported client

Windows XP with SP2 [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 6.0 or later)

See also

SHCreateThread
SHSetThreadRef
SHGetThreadRef
SHReleaseThreadRef

 

 

Community Additions

ADD
Show:
© 2014 Microsoft