You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Represents a *weak reference* that can be used with the Windows Runtime or classic COM. A weak reference represents an object that might or might not be accessible.
28
28
29
-
A **WeakReference** object maintains a *strong reference*, which is a pointer to an object, and a *strong reference count*, which is the number of copies of the strong reference that have been distributed by the `Resolve()` method. While the strong reference count is nonzero, the strong reference is valid and the object is accessible. When the strong reference count becomes zero, the strong reference is invalid and the object is inaccessible.
29
+
A `WeakReference` object maintains a *strong reference*, which is a pointer to an object, and a *strong reference count*, which is the number of copies of the strong reference that have been distributed by the `Resolve()` method. While the strong reference count is nonzero, the strong reference is valid and the object is accessible. When the strong reference count becomes zero, the strong reference is invalid and the object is inaccessible.
30
30
31
-
A **WeakReference** object is typically used to represent an object whose existence is controlled by an external thread or application. For example, construct a **WeakReference** object from a reference to a file object. While the file is open, the strong reference is valid. But if the file is closed, the strong reference becomes invalid.
31
+
A `WeakReference` object is typically used to represent an object whose existence is controlled by an external thread or application. For example, construct a `WeakReference` object from a reference to a file object. While the file is open, the strong reference is valid. But if the file is closed, the strong reference becomes invalid.
32
32
33
-
The **WeakReference** methods are thread safe.
33
+
The `WeakReference` methods are thread safe.
34
34
35
35
## Members
36
36
37
37
### Public Constructors
38
38
39
-
|Name|Description|
40
-
|----------|-----------------|
41
-
|[WeakReference::WeakReference Constructor](../windows/weakreference-weakreference-constructor.md)|Initializes a new instance of the **WeakReference** class.|
42
-
|[WeakReference::~WeakReference Destructor](../windows/weakreference-tilde-weakreference-destructor.md)|Deinitializes (destroys) the current instance of the **WeakReference** class.|
[WeakReference::WeakReference](#weakreference) | Initializes a new instance of the `WeakReference` class.
42
+
[WeakReference::~WeakReference](#tilde-weakreference) | Deinitializes (destroys) the current instance of the `WeakReference` class.
43
43
44
44
### Public Methods
45
45
46
-
|Name|Description|
47
-
|----------|-----------------|
48
-
|[WeakReference::DecrementStrongReference Method](../windows/weakreference-decrementstrongreference-method.md)|Decrements the strong reference count of the current **WeakReference** object.|
49
-
|[WeakReference::IncrementStrongReference Method](../windows/weakreference-incrementstrongreference-method.md)|Increments the strong reference count of the current **WeakReference** object.|
50
-
|[WeakReference::Resolve Method](../windows/weakreference-resolve-method.md)|Sets the specified pointer to the current strong reference value if the strong reference count is nonzero.|
51
-
|[WeakReference::SetUnknown Method](../windows/weakreference-setunknown-method.md)|Sets the strong reference of the current **WeakReference** object to the specified interface pointer.|
0 commit comments