WeakRef::WeakRef Constructor

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at WeakRef::WeakRef Constructor.

Initializes a new instance of the WeakRef class.

WeakRef();  
WeakRef(  
   decltype(__nullptr)  
);  
  
WeakRef(  
   _In_opt_ IWeakReference* ptr  
);  
  
WeakRef(  
   const ComPtr<IWeakReference>& ptr  
);  
  
WeakRef(  
   const WeakRef& ptr  
);  
  
WeakRef(  
   _Inout_ WeakRef&& ptr  
);  

Parameters

ptr
A pointer, reference, or rvalue-reference to an existing object that initializes the current WeakRef object.

The first constructor initializes an empty WeakRef object. The second constructor initializes a WeakRef object from a pointer to the IWeakReference interface. The third constructor initializes a WeakRef object from a reference to a ComPtr< IWeakReference> object. The fourth and fifth constructors initializes a WeakRef object from another WeakRef object.

Header: client.h

Namespace: Microsoft::WRL

WeakRef Class

Show: