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
Copy file name to clipboardexpand all lines: docs/cpp/unhook.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -44,8 +44,8 @@ long __unhook(
44
44
45
45
- Managed events: *SourceClass* is the event source class and *EventMethod* is the event.
46
46
47
-
`interface`
48
-
The interface name being unhooked from `receiver`, only for COM event receivers in which the *layout_dependent* parameter of the [event_receiver](../windows/event-receiver.md) attribute is **true**.
47
+
*interface*
48
+
The interface name being unhooked from *receiver*, only for COM event receivers in which the *layout_dependent* parameter of the [event_receiver](../windows/event-receiver.md) attribute is **true**.
49
49
50
50
*source*
51
51
A pointer to an instance of the event source. Depending on the code `type` specified in **event_receiver**, *source* can be one of the following:
@@ -57,34 +57,34 @@ long __unhook(
57
57
- A managed object pointer (for managed events).
58
58
59
59
**&***ReceiverClass*`::``HandlerMethod`
60
-
A pointer to the event handler method to be unhooked from an event. The handler is specified as a method of a class or a reference to the same; if you do not specify the class name, `__unhook` assumes the class to be that in which it is called.
60
+
A pointer to the event handler method to be unhooked from an event. The handler is specified as a method of a class or a reference to the same; if you do not specify the class name, **__unhook** assumes the class to be that in which it is called.
61
61
62
62
- Native C++ events: *ReceiverClass* is the event receiver class and `HandlerMethod` is the handler.
63
63
64
64
- COM events: *ReceiverClass* is the event receiver interface and `HandlerMethod` is one of its handlers.
65
65
66
66
- Managed events: *ReceiverClass* is the event receiver class and `HandlerMethod` is the handler.
67
67
68
-
`receiver`(optional)
69
-
A pointer to an instance of the event receiver class. If you do not specify a receiver, the default is the receiver class or structure in which `__unhook` is called.
68
+
*receiver*(optional)
69
+
A pointer to an instance of the event receiver class. If you do not specify a receiver, the default is the receiver class or structure in which **__unhook** is called.
70
70
71
71
## Usage
72
72
Can be use in any function scope, including main, outside the event receiver class.
73
73
74
74
## Remarks
75
-
Use the intrinsic function `__unhook` in an event receiver to dissociate or "unhook" a handler method from an event method.
75
+
Use the intrinsic function **__unhook** in an event receiver to dissociate or "unhook" a handler method from an event method.
76
76
77
-
There are three forms of `__unhook`. You can use the first (four-argument) form in most cases. You can use the second (two-argument) form of `__unhook` only for a COM event receiver; this unhooks the entire event interface. You can use the third (one-argument) form to unhook all delegates from the specified source.
77
+
There are three forms of **__unhook**. You can use the first (four-argument) form in most cases. You can use the second (two-argument) form of **__unhook** only for a COM event receiver; this unhooks the entire event interface. You can use the third (one-argument) form to unhook all delegates from the specified source.
78
78
79
79
A nonzero return value indicates that an error has occurred (managed events will throw an exception).
80
80
81
-
If you call `__unhook` on an event and event handler that are not already hooked, it will have no effect.
81
+
If you call **__unhook** on an event and event handler that are not already hooked, it will have no effect.
82
82
83
83
At compile time, the compiler verifies that the event exists and does parameter type checking with the specified handler.
84
84
85
-
With the exception of COM events, `__hook` and `__unhook` can be called outside the event receiver.
85
+
With the exception of COM events, **__hook** and **__unhook** can be called outside the event receiver.
86
86
87
-
An alternative to using `__unhook` is to use the -= operator.
87
+
An alternative to using **__unhook** is to use the -= operator.
88
88
89
89
For information on coding managed events in the new syntax, see [event](../windows/event-cpp-component-extensions.md).
Copy file name to clipboardexpand all lines: docs/cpp/uniform-initialization-and-delegating-constructors.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ int main()
82
82
}
83
83
```
84
84
85
-
You can use brace initialization anywhere you would typically do initialization—for example, as a function parameter or a return value, or with the `new` keyword:
85
+
You can use brace initialization anywhere you would typically do initialization—for example, as a function parameter or a return value, or with the **new** keyword:
Copy file name to clipboardexpand all lines: docs/cpp/unions.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.author: "mblome"
13
13
ms.workload: ["cplusplus"]
14
14
---
15
15
# Unions
16
-
A `union` is a user-defined type in which all members share the same memory location. This means that at any given time a union can contain no more than one object from its list of members. It also means that no matter how many members a union has, it always uses only enough memory to store the largest member.
16
+
A **union** is a user-defined type in which all members share the same memory location. This means that at any given time a union can contain no more than one object from its list of members. It also means that no matter how many members a union has, it always uses only enough memory to store the largest member.
17
17
18
18
Unions can be useful for conserving memory when you have lots of objects and/or limited memory. However they require extra care to use correctly because you are responsible for ensuring that you always access the last member that was written to. If any member types have a non-trivial constructor, then you must write additional code to explicitly construct and destroy that member. Before using a union, consider whether the problem you are trying to solve could be better expressed by using a base class and derived classes.
19
19
@@ -24,16 +24,16 @@ union [name] { member-list };
24
24
```
25
25
26
26
#### Parameters
27
-
`name`
27
+
*name*
28
28
The type name given to the union.
29
29
30
-
`member-list`
30
+
*member-list*
31
31
Members that the union can contain. See Remarks.
32
32
33
33
## Remarks
34
34
35
35
## Declaring a Union
36
-
Begin the declaration of a union with the `union` keyword, and enclose the member list in curly braces:
36
+
Begin the declaration of a union with the **union** keyword, and enclose the member list in curly braces:
Copy file name to clipboardexpand all lines: docs/cpp/user-defined-literals-cpp.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ int main(int argc, char* argv[])
94
94
}
95
95
```
96
96
97
-
Note that the literal number must use a decimal, otherwise the number would be interpreted as an integer and the type would not be compatible with the operator. Also note that for floating point input, the type must be `long double`, and for integral types it must be `long long`.
97
+
Note that the literal number must use a decimal, otherwise the number would be interpreted as an integer and the type would not be compatible with the operator. Also note that for floating point input, the type must be **long double**, and for integral types it must be **long long**.
98
98
99
99
## Raw literals
100
100
In a raw user-defined literal, the operator that you define accepts the literal as a sequence of char values and it is up to you to interpret that sequence as a number or string or other type. In the list of operators shown earlier in this page, `_r` and `_t` can be used to define raw literals:
0 commit comments