Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

WeakRef::CopyTo Method

Assigns a pointer to an interface, if available, to the specified pointer variable.

HRESULT CopyTo(
   REFIID riid,
   _Deref_out_ IInspectable** ptr
);

template<
   typename U
>
HRESULT CopyTo(
   _Deref_out_ U** ptr
);

HRESULT CopyTo(
   _Deref_out_ IWeakReference** ptr
);
U

Pointer an IInspectable interface. An error is emitted if U is not derived from IInspectable.

riid

An interface ID. An error is emitted if riid is not derived from IWeakReference.

ptr

A doubly-indirect pointer to IInspectable or IWeakReference.

S_OK if successful; otherwise, an HRESULT that describes the failure. For more information, see Remarks.

A return value of S_OK means that this operation succeeded, but doesn't indicate whether the weak reference was resolved to a strong reference. If S_OK is returned, test that parameter p is a strong reference; that is, parameter p isn't equal to nullptr.

Header: client.h

Namespace: Microsoft::WRL

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.