Share via


AsWeak Function

Retrieves a weak reference to a specified instance.

template<
   typename T
>
HRESULT AsWeak(
   _In_ T* p,
   _Out_ WeakRef* pWeak
);

Parameters

  • T
    A pointer to the type of parameter p.

  • p
    An instance of a type.

  • pWeak
    When this operation completes, a pointer to a weak reference to parameter p.

Return Value

S_OK, if this operation is successful; otherwise, an error HRESULT that indicates the cause of the failure.

Requirements

Header: client.h

Namespace: Microsoft::WRL

See Also

Reference

Microsoft::WRL Namespace