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
Calls **IUnknown::QueryInterface** on the encapsulated interface pointer with the specified **IID** and returns the resulting raw interface pointer in `p`. This routine returns the `HRESULT` to indicate success or failure.
42
+
Calls `IUnknown::QueryInterface` on the encapsulated interface pointer with the specified `IID` and returns the resulting raw interface pointer in *p*. This routine returns the HRESULT to indicate success or failure.
Copy file name to clipboardExpand all lines: docs/cpp/com-ptr-t-relational-operators.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
15
15
# _com_ptr_t Relational Operators
16
16
**Microsoft Specific**
17
17
18
-
Compare the smart pointer object to another smart pointer, raw interface pointer, or **NULL**.
18
+
Compare the smart pointer object to another smart pointer, raw interface pointer, or NULL.
19
19
20
20
## Syntax
21
21
@@ -90,7 +90,7 @@ bool operator>=( _InterfaceType* p );
90
90
```
91
91
92
92
## Remarks
93
-
Compares a smart pointer object to another smart pointer, raw interface pointer, or **NULL**. Except for the **NULL** pointer tests, these operators first query both pointers for **IUnknown**, and compare the results.
93
+
Compares a smart pointer object to another smart pointer, raw interface pointer, or NULL. Except for the NULL pointer tests, these operators first query both pointers for `IUnknown`, and compare the results.
`_com_raise_error`, which is defined in \<comdef.h>, can be replaced by a user-written version of the same name and prototype. This could be done if you want to use `#import` but do not want to use C++ exception handling. In that case, a user version of **_com_raise_error** might decide to do a `longjmp` or display a message box and halt. The user version should not return, though, because the compiler COM support code does not expect it to return.
38
+
`_com_raise_error`, which is defined in \<comdef.h>, can be replaced by a user-written version of the same name and prototype. This could be done if you want to use `#import` but do not want to use C++ exception handling. In that case, a user version of `_com_raise_error` might decide to do a `longjmp` or display a message box and halt. The user version should not return, though, because the compiler COM support code does not expect it to return.
39
39
40
40
You can also use [_set_com_error_handler](../cpp/set-com-error-handler.md) to replace the default error-handling function.
Copy file name to clipboardExpand all lines: docs/cpp/compiler-com-support-classes.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ ms.workload: ["cplusplus"]
21
21
|-----------|-------------|
22
22
|[_bstr_t](../cpp/bstr-t-class.md)|Wraps the `BSTR` type to provide useful operators and methods.|
23
23
|[_com_error](../cpp/com-error-class.md)|Defines the error object thrown by [_com_raise_error](../cpp/com-raise-error.md) in most failures.|
24
-
|[_com_ptr_t](../cpp/com-ptr-t-class.md)|Encapsulates COM interface pointers, and automates the required calls to `AddRef`, **Release**, and `QueryInterface`.|
25
-
|[_variant_t](../cpp/variant-t-class.md)|Wraps the **VARIANT** type to provide useful operators and methods.|
24
+
|[_com_ptr_t](../cpp/com-ptr-t-class.md)|Encapsulates COM interface pointers, and automates the required calls to `AddRef`, `Release`, and `QueryInterface`.|
25
+
|[_variant_t](../cpp/variant-t-class.md)|Wraps the `VARIANT` type to provide useful operators and methods.|
Copy file name to clipboardExpand all lines: docs/cpp/compiler-com-support.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ ms.workload: ["cplusplus"]
19
19
20
20
You can use the [__declspec](../cpp/declspec.md) extended attribute [uuid](../cpp/uuid-cpp.md) to assign a globally unique identifier (GUID) to a COM object. The keyword [__uuidof](../cpp/uuidof-operator.md) can be used to extract the GUID associated with a COM object. Another `__declspec` attribute, [property](../cpp/property-cpp.md), can be used to specify the **get** and **set** methods for a data member of a COM object.
21
21
22
-
A set of COM support global functions and classes is provided to support the **VARIANT** and `BSTR` types, implement smart pointers, and encapsulate the error object thrown by `_com_raise_error`:
22
+
A set of COM support global functions and classes is provided to support the `VARIANT` and `BSTR` types, implement smart pointers, and encapsulate the error object thrown by `_com_raise_error`:
23
23
24
24
-[Compiler COM Global Functions](../cpp/compiler-com-global-functions.md)
Copy file name to clipboardExpand all lines: docs/cpp/compiler-limits.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,15 @@ The C++ standard recommends limits for various language constructs. The followin
20
20
21
21
- Arguments in one macro invocation - C++ standard: 256, Visual C++ compiler 127.
22
22
23
-
- Characters in a character string literal or wide string literal (after concatenation) - C++ standard: 65536, Visual C++ compiler: 65535 single-byte characters, including the `null` terminator, and 32767 double-byte characters, including the `null` terminator.
23
+
- Characters in a character string literal or wide string literal (after concatenation) - C++ standard: 65536, Visual C++ compiler: 65535 single-byte characters, including the NULL terminator, and 32767 double-byte characters, including the NULL terminator.
24
24
25
25
- Levels of nested class, structure, or union definitions in a single `struct-declaration-list` - C++ standard: 256, Visual C++ compiler: 16.
26
26
27
27
- Member initializers in a constructor definition - C++ standard: 6144, Visual C++ compiler: at least 6144.
28
28
29
29
- Scope qualifications of one identifier - C++ standard: 256, Visual C++ compiler: 127.
30
30
31
-
- Nested `extern` specifications - C++ standard: 1024, Visual C++ compiler: 9 (not counting the implicit `extern` specification in global scope, or 10, if you count the implicit `extern` specification in global scope..
31
+
- Nested **extern** specifications - C++ standard: 1024, Visual C++ compiler: 9 (not counting the implicit **extern** specification in global scope, or 10, if you count the implicit **extern** specification in global scope..
32
32
33
33
- Template arguments in a template declaration - C++ standard: 1024, Visual C++ compiler: 2046.
- The first operand is implicitly converted to `bool`. It is evaluated and all side effects are completed before continuing.
27
27
28
-
- If the first operand evaluates to **true** (1), the second operand is evaluated.
28
+
- If the first operand evaluates to TRUE (1), the second operand is evaluated.
29
29
30
-
- If the first operand evaluates to **false** (0), the third operand is evaluated.
30
+
- If the first operand evaluates to FALSE (0), the third operand is evaluated.
31
31
32
32
The result of the conditional operator is the result of whichever operand is evaluated — the second or the third. Only one of the last two operands is evaluated in a conditional expression.
Copy file name to clipboardExpand all lines: docs/cpp/considerations-for-writing-prolog-epilog-code.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.workload: ["cplusplus"]
13
13
---
14
14
# Considerations for Writing Prolog/Epilog Code
15
15
## Microsoft Specific
16
-
Before writing your own prolog and epilog code sequences, it is important to understand how the stack frame is laid out. It is also useful to know how to use the **__LOCAL_SIZE** symbol.
16
+
Before writing your own prolog and epilog code sequences, it is important to understand how the stack frame is laid out. It is also useful to know how to use the __LOCAL_SIZE symbol.
This example shows the standard prolog code that might appear in a 32-bit function:
@@ -37,16 +37,16 @@ ret ; Return from function
37
37
The stack always grows down (from high to low memory addresses). The base pointer (`ebp`) points to the pushed value of `ebp`. The locals area begins at `ebp-4`. To access local variables, calculate an offset from `ebp` by subtracting the appropriate value from `ebp`.
The compiler provides a symbol, **__LOCAL_SIZE**, for use in the inline assembler block of function prolog code. This symbol is used to allocate space for local variables on the stack frame in custom prolog code.
40
+
The compiler provides a symbol, __LOCAL_SIZE, for use in the inline assembler block of function prolog code. This symbol is used to allocate space for local variables on the stack frame in custom prolog code.
41
41
42
-
The compiler determines the value of **__LOCAL_SIZE**. Its value is the total number of bytes of all user-defined local variables and compiler-generated temporary variables. **__LOCAL_SIZE** can be used only as an immediate operand; it cannot be used in an expression. You must not change or redefine the value of this symbol. For example:
42
+
The compiler determines the value of __LOCAL_SIZE. Its value is the total number of bytes of all user-defined local variables and compiler-generated temporary variables. __LOCAL_SIZE can be used only as an immediate operand; it cannot be used in an expression. You must not change or redefine the value of this symbol. For example:
43
43
44
44
```
45
45
mov eax, __LOCAL_SIZE ;Immediate operand--Okay
46
46
mov eax, [ebp - __LOCAL_SIZE] ;Error
47
47
```
48
48
49
-
The following example of a naked function containing custom prolog and epilog sequences uses the **__LOCAL_SIZE** symbol in the prolog sequence:
49
+
The following example of a naked function containing custom prolog and epilog sequences uses the __LOCAL_SIZE symbol in the prolog sequence:
Copy file name to clipboardExpand all lines: docs/cpp/const-and-volatile-pointers.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,18 +14,18 @@ ms.workload: ["cplusplus"]
14
14
# const and volatile Pointers
15
15
The [const](../cpp/const-cpp.md) and [volatile](../cpp/volatile-cpp.md) keywords change how pointers are treated. The **const** keyword specifies that the pointer cannot be modified after initialization; the pointer is protected from modification thereafter.
16
16
17
-
The `volatile` keyword specifies that the value associated with the name that follows can be modified by actions other than those in the user application. Therefore, the `volatile` keyword is useful for declaring objects in shared memory that can be accessed by multiple processes or global data areas used for communication with interrupt service routines.
17
+
The **volatile** keyword specifies that the value associated with the name that follows can be modified by actions other than those in the user application. Therefore, the **volatile** keyword is useful for declaring objects in shared memory that can be accessed by multiple processes or global data areas used for communication with interrupt service routines.
18
18
19
-
When a name is declared as `volatile`, the compiler reloads the value from memory each time it is accessed by the program. This dramatically reduces the possible optimizations. However, when the state of an object can change unexpectedly, it is the only way to ensure predictable program performance.
19
+
When a name is declared as **volatile**, the compiler reloads the value from memory each time it is accessed by the program. This dramatically reduces the possible optimizations. However, when the state of an object can change unexpectedly, it is the only way to ensure predictable program performance.
20
20
21
-
To declare the object pointed to by the pointer as **const** or `volatile`, use a declaration of the form:
21
+
To declare the object pointed to by the pointer as **const** or **volatile**, use a declaration of the form:
22
22
23
23
```cpp
24
24
constchar *cpch;
25
25
volatilechar *vpch;
26
26
```
27
27
28
-
To declare the value of the pointer — that is, the actual address stored in the pointer — as **const** or `volatile`, use a declaration of the form:
28
+
To declare the value of the pointer — that is, the actual address stored in the pointer — as **const** or **volatile**, use a declaration of the form:
29
29
30
30
```cpp
31
31
char * const pchc;
@@ -57,7 +57,7 @@ char *pch2 = &cch; // Error
57
57
char *const pch3 = &cch; // Error
58
58
```
59
59
60
-
The declaration of `pch2` declares a pointer through which a constant object might be modified and is therefore disallowed. The declaration of `pch3` specifies that the `pointer` is constant, not the object; the declaration is disallowed for the same reason the `pch2` declaration is disallowed.
60
+
The declaration of `pch2` declares a pointer through which a constant object might be modified and is therefore disallowed. The declaration of `pch3` specifies that the **pointer** is constant, not the object; the declaration is disallowed for the same reason the `pch2` declaration is disallowed.
61
61
62
62
The following eight assignments show assigning through pointer and changing of pointer value for the preceding declarations; for now, assume that the initialization was correct for `pch1` through `pch8`.
The preceding statement declares a function, [strcpy_s](../c-runtime-library/reference/strcpy-s-wcscpy-s-mbscpy-s.md), where two of the three arguments are of type pointer to `char`. Because the arguments are passed by reference and not by value, the function would be free to modify both `strDestination` and `strSource` if `strSource` were not declared as **const**. The declaration of `strSource` as **const** assures the caller that `strSource` cannot be changed by the called function.
83
+
The preceding statement declares a function, [strcpy_s](../c-runtime-library/reference/strcpy-s-wcscpy-s-mbscpy-s.md), where two of the three arguments are of type pointer to **char**. Because the arguments are passed by reference and not by value, the function would be free to modify both `strDestination` and `strSource` if `strSource` were not declared as **const**. The declaration of `strSource` as **const** assures the caller that `strSource` cannot be changed by the called function.
84
84
85
85
> [!NOTE]
86
86
> Because there is a standard conversion from *typename* **\*** to **const** *typename* **\***, it is legal to pass an argument of type **char \*** to [strcpy_s](../c-runtime-library/reference/strcpy-s-wcscpy-s-mbscpy-s.md). However, the reverse is not true; no implicit conversion exists to remove the **const** attribute from an object or pointer.
0 commit comments