Skip to content

Commit ad65a8f

Browse files
authored
Merge pull request #4686 from corob-msft/learn/corob/cpp-docs-2128
Fix cpp-docs 2128, 4296
2 parents 990722c + 71f392f commit ad65a8f

16 files changed

+180
-180
lines changed

docs/cpp/com-error-class.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
11
---
22
description: "Learn more about: _com_error Class"
33
title: "_com_error Class"
4-
ms.date: "11/04/2016"
4+
ms.date: 11/17/2022
55
f1_keywords: ["_com_error"]
66
helpviewer_keywords: ["_com_error class"]
77
ms.assetid: 70dafa69-b1fb-4a5c-9249-e857e0793d42
88
---
9-
# _com_error Class
9+
# `_com_error` class
1010

1111
**Microsoft Specific**
1212

13-
A **_com_error** object represents an exception condition detected by the error-handling wrapper functions in the header files generated from the type library or by one of the COM support classes. The **_com_error** class encapsulates the HRESULT error code and any associated `IErrorInfo Interface` object.
13+
A `_com_error` object represents an exception condition detected by the error-handling wrapper functions in the header files generated from the type library or by one of the COM support classes. The `_com_error` class encapsulates the `HRESULT` error code and any associated `IErrorInfo Interface` object.
1414

1515
### Construction
1616

1717
| Name | Description |
18-
|-|-|
19-
|[_com_error](../cpp/com-error-com-error.md)|Constructs a **_com_error** object.|
18+
|---|---|
19+
| [`_com_error`](../cpp/com-error-com-error.md) | Constructs a `_com_error` object. |
2020

2121
### Operators
2222

2323
| Name | Description |
24-
|-|-|
25-
|[operator =](../cpp/com-error-operator-equal.md)|Assigns an existing **_com_error** object to another.|
24+
|---|---|
25+
| [`operator =`](../cpp/com-error-operator-equal.md) | Assigns an existing `_com_error` object to another. |
2626

27-
### Extractor Functions
27+
### Extractor functions
2828

2929
| Name | Description |
30-
|-|-|
31-
|[Error](../cpp/com-error-error.md)|Retrieves the HRESULT passed to the constructor.|
32-
|[ErrorInfo](../cpp/com-error-errorinfo.md)|Retrieves the `IErrorInfo` object passed to the constructor.|
33-
|[WCode](../cpp/com-error-wcode.md)|Retrieves the 16-bit error code mapped into the encapsulated HRESULT.|
30+
|---|---|
31+
| [`Error`](../cpp/com-error-error.md) | Retrieves the `HRESULT` passed to the constructor. |
32+
| [`ErrorInfo`](../cpp/com-error-errorinfo.md) | Retrieves the `IErrorInfo` object passed to the constructor. |
33+
| [`WCode`](../cpp/com-error-wcode.md) | Retrieves the 16-bit error code mapped into the encapsulated `HRESULT`. |
3434

35-
### IErrorInfo Functions
35+
### `IErrorInfo` functions
3636

3737
| Name | Description |
38-
|-|-|
39-
|[Description](../cpp/com-error-description.md)|Calls `IErrorInfo::GetDescription` function.|
40-
|[HelpContext](../cpp/com-error-helpcontext.md)|Calls `IErrorInfo::GetHelpContext` function.|
41-
|[HelpFile](../cpp/com-error-helpfile.md)|Calls `IErrorInfo::GetHelpFile` function|
42-
|[Source](../cpp/com-error-source.md)|Calls `IErrorInfo::GetSource` function.|
43-
|[GUID](../cpp/com-error-guid.md)|Calls `IErrorInfo::GetGUID` function.|
38+
|---|---|
39+
| [`Description`](../cpp/com-error-description.md) | Calls `IErrorInfo::GetDescription` function. |
40+
| [`HelpContext`](../cpp/com-error-helpcontext.md) | Calls `IErrorInfo::GetHelpContext` function. |
41+
| [`HelpFile`](../cpp/com-error-helpfile.md) | Calls `IErrorInfo::GetHelpFile` function |
42+
| [`Source`](../cpp/com-error-source.md) | Calls `IErrorInfo::GetSource` function. |
43+
| [`GUID`](../cpp/com-error-guid.md) | Calls `IErrorInfo::GetGUID` function. |
4444

45-
### Format Message Extractor
45+
### Format message extractor
4646

4747
| Name | Description |
48-
|-|-|
49-
|[ErrorMessage](../cpp/com-error-errormessage.md)|Retrieves the string message for HRESULT stored in the **_com_error** object.|
48+
|---|---|
49+
| [`ErrorMessage`](../cpp/com-error-errormessage.md) | Retrieves the string message for `HRESULT` stored in the `_com_error` object. |
5050

51-
### ExepInfo.wCode to HRESULT Mappers
51+
### `ExepInfo.wCode` to `HRESULT` mappers
5252

5353
| Name | Description |
54-
|-|-|
55-
|[HRESULTToWCode](../cpp/com-error-hresulttowcode.md)|Maps 32-bit HRESULT to 16-bit `wCode`.|
56-
|[WCodeToHRESULT](../cpp/com-error-wcodetohresult.md)|Maps 16-bit `wCode` to 32-bit HRESULT.|
54+
|---|---|
55+
| [`HRESULTToWCode`](../cpp/com-error-hresulttowcode.md) | Maps 32-bit `HRESULT` to 16-bit `wCode`. |
56+
| [`WCodeToHRESULT`](../cpp/com-error-wcodetohresult.md) | Maps 16-bit `wCode` to 32-bit `HRESULT`. |
5757

5858
**END Microsoft Specific**
5959

6060
## Requirements
6161

6262
**Header:** \<comdef.h>
6363

64-
`Lib:` comsuppw.lib or comsuppwd.lib (see [/Zc:wchar_t (wchar_t Is Native Type)](../build/reference/zc-wchar-t-wchar-t-is-native-type.md) for more information)
64+
**Library:** *`comsuppw.lib`* or *`comsuppwd.lib`* (for more information, see [`/Zc:wchar_t` (wchar_t is native type)](../build/reference/zc-wchar-t-wchar-t-is-native-type.md))
6565

6666
## See also
6767

68-
[Compiler COM Support Classes](../cpp/compiler-com-support-classes.md)<br/>
69-
[IErrorInfo Interface](/windows/win32/api/oaidl/nn-oaidl-ierrorinfo)
68+
[Compiler COM support classes](../cpp/compiler-com-support-classes.md)\
69+
[`IErrorInfo` interface](/windows/win32/api/oaidl/nn-oaidl-ierrorinfo)

docs/cpp/com-error-com-error.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
---
22
description: "Learn more about: _com_error::_com_error"
33
title: "_com_error::_com_error"
4-
ms.date: "11/04/2016"
5-
f1_keywords: ["_com_error::_com_error"]
6-
helpviewer_keywords: ["_com_error method [C++]"]
4+
ms.date: 11/17/2022
5+
f1_keywords: ["COMDEF/_com_error", "_com_error::_com_error"]
6+
helpviewer_keywords: ["_com_error constructor [C++]"]
77
ms.assetid: 0a69e46c-caab-49ef-b091-eee401253ce6
88
---
9-
# _com_error::_com_error
9+
# `_com_error::_com_error`
1010

1111
**Microsoft Specific**
1212

13-
Constructs a **_com_error** object.
13+
Constructs a `_com_error` object.
1414

1515
## Syntax
1616

17-
```
17+
```cpp
1818
_com_error(
1919
HRESULT hr,
2020
IErrorInfo* perrinfo = NULL,
21-
bool fAddRef=false) throw( );
21+
bool fAddRef = false) throw();
2222

23-
_com_error( const _com_error& that ) throw( );
23+
_com_error( const _com_error& that ) throw();
2424
```
2525
26-
#### Parameters
26+
### Parameters
2727
28-
*hr*<br/>
29-
HRESULT information.
28+
*`hr`*\
29+
`HRESULT` information.
3030
31-
*perrinfo*<br/>
31+
*`perrinfo`*\
3232
`IErrorInfo` object.
3333
34-
*fAddRef*<br/>
35-
The default causes the constructor to call AddRef on a non-null `IErrorInfo` interface. This provides for correct reference counting in the common case where ownership of the interface is passed into the **_com_error** object, such as:
34+
*`fAddRef`*\
35+
The default causes the constructor to not call AddRef on a non-null `IErrorInfo` interface. This behavior provides for correct reference counting in the common case where ownership of the interface is passed into the `_com_error` object, such as:
3636
3737
```cpp
3838
throw _com_error(hr, perrinfo);
3939
```
4040

41-
If you do not want your code to transfer ownership to the **_com_error** object, and the `AddRef` is required to offset the `Release` in the **_com_error** destructor, construct the object as follows:
41+
If you don't want your code to transfer ownership to the `_com_error` object, and the `AddRef` is required to offset the `Release` in the `_com_error` destructor, construct the object as follows:
4242

4343
```cpp
4444
_com_error err(hr, perrinfo, true);
4545
```
4646
47-
*that*<br/>
48-
An existing **_com_error** object.
47+
*`that`*\
48+
An existing `_com_error` object.
4949
5050
## Remarks
5151
52-
The first constructor creates a new object given an HRESULT and optional `IErrorInfo` object. The second creates a copy of an existing **_com_error** object.
52+
The first constructor creates a new object given an `HRESULT` and optional `IErrorInfo` object. The second creates a copy of an existing `_com_error` object.
5353
5454
**END Microsoft Specific**
5555
5656
## See also
5757
58-
[_com_error Class](../cpp/com-error-class.md)
58+
[`_com_error` class](../cpp/com-error-class.md)

docs/cpp/com-error-description.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
22
description: "Learn more about: _com_error::Description"
33
title: "_com_error::Description"
4-
ms.date: "11/04/2016"
5-
f1_keywords: ["_com_error::Description"]
6-
helpviewer_keywords: ["Description method [C++]"]
4+
ms.date: 11/17/2022
5+
f1_keywords: ["COMDEF/_com_error::Description", "_com_error::Description"]
6+
helpviewer_keywords: ["_com_error Description method [C++]"]
77
ms.assetid: 88191e24-4ee8-44a6-8c4c-3758e22e0548
88
---
9-
# _com_error::Description
9+
# `_com_error::Description`
1010

1111
**Microsoft Specific**
1212

1313
Calls `IErrorInfo::GetDescription` function.
1414

1515
## Syntax
1616

17-
```
18-
_bstr_t Description( ) const;
17+
```cpp
18+
_bstr_t Description() const;
1919
```
2020

21-
## Return Value
21+
## Return value
2222

2323
Returns the result of `IErrorInfo::GetDescription` for the `IErrorInfo` object recorded within the `_com_error` object. The resulting `BSTR` is encapsulated in a `_bstr_t` object. If no `IErrorInfo` is recorded, it returns an empty `_bstr_t`.
2424

@@ -30,4 +30,4 @@ Calls the `IErrorInfo::GetDescription` function and retrieves `IErrorInfo` recor
3030

3131
## See also
3232

33-
[_com_error Class](../cpp/com-error-class.md)
33+
[`_com_error` class](../cpp/com-error-class.md)

docs/cpp/com-error-error.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
---
22
description: "Learn more about: _com_error::Error"
33
title: "_com_error::Error"
4-
ms.date: "11/04/2016"
5-
f1_keywords: ["_com_error::Error", "Error"]
6-
helpviewer_keywords: ["Error method [C++]"]
4+
ms.date: 11/17/2022
5+
f1_keywords: ["COMDEF/_com_error::Error", "_com_error::Error"]
6+
helpviewer_keywords: ["_com_error Error method [C++]"]
77
ms.assetid: b53a15fd-198e-4276-afcd-13439c4807f7
88
---
9-
# _com_error::Error
9+
# `_com_error::Error`
1010

1111
**Microsoft Specific**
1212

13-
Retrieves the HRESULT passed to the constructor.
13+
Retrieves the `HRESULT` passed to the constructor.
1414

1515
## Syntax
1616

17-
```
18-
HRESULT Error( ) const throw( );
17+
```cpp
18+
HRESULT Error() const throw();
1919
```
2020

21-
## Return Value
21+
## Return value
2222

23-
Raw HRESULT item passed into the constructor.
23+
Raw `HRESULT` item passed into the constructor.
2424

2525
## Remarks
2626

27-
Retrieves the encapsulated HRESULT item in a `_com_error` object.
27+
Retrieves the encapsulated `HRESULT` item in a `_com_error` object.
2828

2929
**END Microsoft Specific**
3030

3131
## See also
3232

33-
[_com_error Class](../cpp/com-error-class.md)
33+
[`_com_error` class](../cpp/com-error-class.md)

docs/cpp/com-error-errorinfo.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
description: "Learn more about: _com_error::ErrorInfo"
33
title: "_com_error::ErrorInfo"
4-
ms.date: "11/04/2016"
5-
f1_keywords: ["_com_error::ErrorInfo"]
6-
helpviewer_keywords: ["ErrorInfo method [C++]"]
4+
ms.date: 11/17/2022
5+
f1_keywords: ["COMDEF/_com_error::ErrorInfo", "_com_error::ErrorInfo"]
6+
helpviewer_keywords: ["_com_error ErrorInfo method [C++]"]
77
ms.assetid: 071b446c-4395-4fb8-bd3d-300a8b25f5cd
88
---
99
# _com_error::ErrorInfo
@@ -14,20 +14,20 @@ Retrieves the `IErrorInfo` object passed to the constructor.
1414

1515
## Syntax
1616

17-
```
17+
```cpp
1818
IErrorInfo * ErrorInfo( ) const throw( );
1919
```
2020
21-
## Return Value
21+
## Return value
2222
2323
Raw `IErrorInfo` item passed into the constructor.
2424
2525
## Remarks
2626
27-
Retrieves the encapsulated `IErrorInfo` item in a `_com_error` object, or NULL if no `IErrorInfo` item is recorded. The caller must call `Release` on the returned object when finished using it.
27+
Retrieves the encapsulated `IErrorInfo` item in a `_com_error` object, or `NULL` if no `IErrorInfo` item is recorded. The caller must call `Release` on the returned object when finished using it.
2828
2929
**END Microsoft Specific**
3030
3131
## See also
3232
33-
[_com_error Class](../cpp/com-error-class.md)
33+
[`_com_error` class](../cpp/com-error-class.md)

docs/cpp/com-error-errormessage.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
---
22
description: "Learn more about: _com_error::ErrorMessage"
33
title: "_com_error::ErrorMessage"
4-
ms.date: "11/04/2016"
5-
f1_keywords: ["_com_error::ErrorMessage"]
6-
helpviewer_keywords: ["ErrorMessage method [C++]"]
4+
ms.date: 11/17/2022
5+
f1_keywords: ["COMDEF/_com_error::ErrorMessage", "_com_error::ErrorMessage"]
6+
helpviewer_keywords: ["_com_error ErrorMessage method [C++]"]
77
ms.assetid: e47335b6-01af-4975-a841-121597479eb7
88
---
9-
# _com_error::ErrorMessage
9+
# `_com_error::ErrorMessage`
1010

1111
**Microsoft Specific**
1212

13-
Retrieves the string message for HRESULT stored in the `_com_error` object.
13+
Retrieves the string message for `HRESULT` stored in the `_com_error` object.
1414

1515
## Syntax
1616

17-
```
18-
const TCHAR * ErrorMessage( ) const throw( );
17+
```cpp
18+
const TCHAR * ErrorMessage() const throw();
1919
```
2020

21-
## Return Value
21+
## Return value
2222

23-
Returns the string message for the HRESULT recorded within the `_com_error` object. If the HRESULT is a mapped 16-bit [wCode](../cpp/com-error-wcode.md), then a generic message "`IDispatch error #<wCode>`" is returned. If no message is found, then a generic message "`Unknown error #<hresult>`" is returned. The returned string is either a Unicode or multibyte string, depending on the state of the _UNICODE macro.
23+
Returns the string message for the `HRESULT` recorded within the `_com_error` object. If the `HRESULT` is a mapped 16-bit [`wCode`](../cpp/com-error-wcode.md), then a generic message "`IDispatch error #<wCode>`" is returned. If no message is found, then a generic message "`Unknown error #<hresult>`" is returned. The returned string is either a Unicode or multibyte string, depending on the state of the `_UNICODE` macro.
2424

2525
## Remarks
2626

27-
Retrieves the appropriate system message text for HRESULT recorded within the `_com_error` object. The system message text is obtained by calling the Win32 [FormatMessage](/windows/win32/api/winbase/nf-winbase-formatmessage) function. The string returned is allocated by the `FormatMessage` API, and it is released when the `_com_error` object is destroyed.
27+
Retrieves the appropriate system message text for `HRESULT` recorded within the `_com_error` object. The system message text is obtained by calling the Win32 [`FormatMessage`](/windows/win32/api/winbase/nf-winbase-formatmessage) function. The string returned is allocated by the `FormatMessage` API, and it's released when the `_com_error` object is destroyed.
2828

2929
**END Microsoft Specific**
3030

3131
## See also
3232

33-
[_com_error Class](../cpp/com-error-class.md)
33+
[`_com_error` class](../cpp/com-error-class.md)

docs/cpp/com-error-guid.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
22
description: "Learn more about: _com_error::GUID"
33
title: "_com_error::GUID"
4-
ms.date: "11/04/2016"
5-
f1_keywords: ["_com_error::GUID"]
6-
helpviewer_keywords: ["GUID method [C++]"]
4+
ms.date: 11/17/2022
5+
f1_keywords: ["COMDEF/_com_error::GUID", "_com_error::GUID"]
6+
helpviewer_keywords: ["_com_error GUID method [C++]"]
77
ms.assetid: e84c2c23-d02e-48f8-b776-9bd6937296d2
88
---
9-
# _com_error::GUID
9+
# `_com_error::GUID`
1010

1111
**Microsoft Specific**
1212

1313
Calls `IErrorInfo::GetGUID` function.
1414

1515
## Syntax
1616

17-
```
18-
GUID GUID( ) const throw( );
17+
```cpp
18+
GUID GUID() const throw();
1919
```
2020

21-
## Return Value
21+
## Return value
2222

2323
Returns the result of `IErrorInfo::GetGUID` for the `IErrorInfo` object recorded within the `_com_error` object. If no `IErrorInfo` object is recorded, it returns `GUID_NULL`.
2424

@@ -30,4 +30,4 @@ Any failure while calling the `IErrorInfo::GetGUID` method is ignored.
3030

3131
## See also
3232

33-
[_com_error Class](../cpp/com-error-class.md)
33+
[`_com_error` class](../cpp/com-error-class.md)

0 commit comments

Comments
 (0)