Skip to content

Commit aa360a9

Browse files
author
Colin Robertson
authored
Loc fixes per ja-jp 264, consolidation and style fixes (#3390)
* Loc issues raised in ja-jp-264 * consistency check * More tweaks after review
1 parent cfa3e38 commit aa360a9

18 files changed

+178
-208
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,16 @@
865865
"redirect_url": "/cpp/cpp/attributes",
866866
"redirect_document_id": false
867867
},
868+
{
869+
"source_path": "docs/cpp/bstr-t-member-functions.md",
870+
"redirect_url": "/cpp/cpp/bstr-t-class",
871+
"redirect_document_id": false
872+
},
873+
{
874+
"source_path": "docs/cpp/bstr-t-operators.md",
875+
"redirect_url": "/cpp/cpp/bstr-t-class",
876+
"redirect_document_id": false
877+
},
868878
{
869879
"source_path": "docs/cpp/character-sets2.md",
870880
"redirect_url": "/cpp/cpp/character-sets",

docs/cpp/bstr-t-assign.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
description: "Learn more about: _bstr_t::Assign"
33
title: "_bstr_t::Assign"
4-
ms.date: "11/04/2016"
4+
ms.date: 02/02/2021
55
f1_keywords: ["_bstr_t::Assign"]
66
helpviewer_keywords: ["Assign method [C++]"]
7-
ms.assetid: 2e209bbe-77ca-4598-86d5-6c2ea213f43c
87
---
9-
# _bstr_t::Assign
8+
# _`bstr_t::Assign`
109

1110
**Microsoft Specific**
1211

@@ -20,14 +19,14 @@ void Assign(
2019
);
2120
```
2221

23-
#### Parameters
22+
### Parameters
2423

25-
*s*<br/>
24+
*`s`*\
2625
A `BSTR` to be copied into the `BSTR` wrapped by a `_bstr_t`.
2726

2827
## Remarks
2928

30-
**Assign** does a binary copy, which means the entire length of the `BSTR` is copied, regardless of content.
29+
**`Assign`** does a binary copy of the entire length of the `BSTR`, whatever the content.
3130

3231
## Example
3332

@@ -106,4 +105,4 @@ bstrWrapper2 = some text
106105

107106
## See also
108107

109-
[_bstr_t Class](../cpp/bstr-t-class.md)
108+
[`_bstr_t` class](../cpp/bstr-t-class.md)

docs/cpp/bstr-t-attach.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
description: "Learn more about: _bstr_t::Attach"
33
title: "_bstr_t::Attach"
4-
ms.date: "11/04/2016"
4+
ms.date: 02/02/2021
55
f1_keywords: ["_bstr_t::Attach"]
66
helpviewer_keywords: ["Attach method [C++]"]
7-
ms.assetid: 8cad867e-40fc-435b-841f-0d412c2f58d3
87
---
9-
# _bstr_t::Attach
8+
# `_bstr_t::Attach`
109

1110
**Microsoft Specific**
1211

@@ -20,9 +19,9 @@ void Attach(
2019
);
2120
```
2221

23-
#### Parameters
22+
### Parameters
2423

25-
*s*<br/>
24+
*`s`*\
2625
A `BSTR` to be associated with, or assigned to, the `_bstr_t` variable.
2726

2827
## Remarks
@@ -31,10 +30,10 @@ If the `_bstr_t` was previously attached to another `BSTR`, the `_bstr_t` will c
3130

3231
## Example
3332

34-
See [_bstr_t::Assign](../cpp/bstr-t-assign.md) for an example using **Attach**.
33+
See [`_bstr_t::Assign`](../cpp/bstr-t-assign.md) for an example using **`Attach`**.
3534

3635
**END Microsoft Specific**
3736

3837
## See also
3938

40-
[_bstr_t Class](../cpp/bstr-t-class.md)
39+
[`_bstr_t` Class](../cpp/bstr-t-class.md)

docs/cpp/bstr-t-bstr-t.md

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
22
description: "Learn more about: _bstr_t::_bstr_t"
33
title: "_bstr_t::_bstr_t"
4-
ms.date: "11/04/2016"
4+
ms.date: 02/02/2021
55
f1_keywords: ["_bstr_t::_bstr_t"]
66
helpviewer_keywords: ["BSTR object", "_bstr_t method [C++]", "_bstr_t class"]
7-
ms.assetid: 116d994e-5a72-4351-afbe-866c80b4c165
87
---
9-
# _bstr_t::_bstr_t
8+
# `_bstr_t::_bstr_t`
109

1110
**Microsoft Specific**
1211

1312
Constructs a `_bstr_t` object.
1413

1514
## Syntax
1615

17-
```
16+
```cpp
1817
_bstr_t( ) throw( );
1918
_bstr_t(
2019
const _bstr_t& s1
@@ -34,42 +33,51 @@ _bstr_t(
3433
);
3534
```
3635

37-
#### Parameters
36+
### Parameters
3837

39-
*s1*<br/>
38+
*`s1`*\
4039
A `_bstr_t` object to be copied.
4140

42-
*s2*<br/>
41+
*`s2`*\
4342
A multibyte string.
4443

45-
*s3*<br/>
44+
*`s3`*\
4645
A Unicode string
4746

48-
*var*<br/>
47+
*`var`*\
4948
A [_variant_t](../cpp/variant-t-class.md) object.
5049

51-
*bstr*<br/>
50+
*`bstr`*\
5251
An existing `BSTR` object.
5352

54-
*fCopy*<br/>
55-
If **`false`**, the *bstr* argument is attached to the new object without making a copy by calling `SysAllocString`.
53+
*`fCopy`*\
54+
If **`false`**, the *`bstr`* argument is attached to the new object without making a copy by calling `SysAllocString`.
5655

5756
## Remarks
5857

59-
The following table describes the `_bstr_t` constructors.
58+
The `_bstr_t` class supplies several constructors:
59+
60+
`_bstr_t( )`\
61+
Constructs a default `_bstr_t` object that encapsulates a null `BSTR` object.
62+
63+
`_bstr_t( _bstr_t& s1 )`\
64+
Constructs a `_bstr_t` object as a copy of another. This constructor makes a *shallow* copy, which increments the reference count of the encapsulated `BSTR` object instead of creating a new one.
65+
66+
`_bstr_t( char* s2 )`\
67+
Constructs a `_bstr_t` object by calling `SysAllocString` to create a new `BSTR` object and then encapsulates it. This constructor first performs a multibyte to Unicode conversion.
68+
69+
`_bstr_t( wchar_t* s3 )`\
70+
Constructs a `_bstr_t` object by calling `SysAllocString` to create a new `BSTR` object and then encapsulates it.
71+
72+
`_bstr_t( _variant_t& var )`\
73+
Constructs a `_bstr_t` object from a `_variant_t` object by first retrieving a `BSTR` object from the encapsulated `VARIANT` object.
6074

61-
|Constructor|Description|
62-
|-----------------|-----------------|
63-
|`_bstr_t( )`|Constructs a default `_bstr_t` object that encapsulates a null `BSTR` object.|
64-
|`_bstr_t( _bstr_t&` `s1` `)`|Constructs a `_bstr_t` object as a copy of another.<br /><br /> This is a *shallow* copy, which increments the reference count of the encapsulated `BSTR` object instead of creating a new one.|
65-
|`_bstr_t( char*` `s2` `)`|Constructs a `_bstr_t` object by calling `SysAllocString` to create a new `BSTR` object and then encapsulates it.<br /><br /> This constructor first performs a multibyte to Unicode conversion.|
66-
|`_bstr_t( wchar_t*` `s3` `)`|Constructs a `_bstr_t` object by calling `SysAllocString` to create a new `BSTR` object and then encapsulates it.|
67-
|`_bstr_t( _variant_t&` `var` `)`|Constructs a `_bstr_t` object from a `_variant_t` object by first retrieving a `BSTR` object from the encapsulated VARIANT object.|
68-
|`_bstr_t( BSTR` `bstr` `, bool` `fCopy` `)`|Constructs a `_bstr_t` object from an existing `BSTR` (as opposed to a `wchar_t*` string). If *fCopy* is false, the supplied `BSTR` is attached to the new object without making a new copy with `SysAllocString`.<br /><br /> This constructor is used by wrapper functions in the type library headers to encapsulate and take ownership of a `BSTR` that is returned by an interface method.|
75+
`_bstr_t( BSTR bstr, bool fCopy )`\
76+
Constructs a `_bstr_t` object from an existing `BSTR` (as opposed to a `wchar_t*` string). If *`fCopy`* is **`false`**, the supplied `BSTR` is attached to the new object without making a new copy by using `SysAllocString`. This constructor is used by wrapper functions in the type library headers to encapsulate and take ownership of a `BSTR` that's returned by an interface method.
6977

7078
**END Microsoft Specific**
7179

7280
## See also
7381

74-
[_bstr_t Class](../cpp/bstr-t-class.md)<br/>
75-
[_variant_t Class](../cpp/variant-t-class.md)
82+
[`_bstr_t` class](../cpp/bstr-t-class.md)\
83+
[`_variant_t` class](../cpp/variant-t-class.md)

docs/cpp/bstr-t-class.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,55 @@
11
---
2-
description: "Learn more about: _bstr_t Class"
3-
title: "_bstr_t Class"
4-
ms.date: "11/04/2016"
2+
title: "_bstr_t class"
3+
description: "Learn more about: _bstr_t class"
4+
ms.date: 02/02/2021
55
f1_keywords: ["_bstr_t"]
66
helpviewer_keywords: ["BSTR object", "_bstr_t class", "BSTR object [C++], COM encapsulation"]
7-
ms.assetid: 58841fef-fe21-4a84-aab9-780262b5201f
87
---
9-
# _bstr_t Class
8+
# `_bstr_t` class
109

1110
**Microsoft Specific**
1211

13-
A `_bstr_t` object encapsulates the [BSTR data type](/previous-versions/windows/desktop/automat/bstr). The class manages resource allocation and deallocation through function calls to `SysAllocString` and `SysFreeString` and other `BSTR` APIs when appropriate. The **_bstr_t** class uses reference counting to avoid excessive overhead.
12+
A `_bstr_t` object encapsulates the [BSTR data type](/previous-versions/windows/desktop/automat/bstr). The class manages resource allocation and deallocation through function calls to [`SysAllocString`](/windows/win32/api/oleauto/nf-oleauto-sysallocstring) and [`SysFreeString`](/windows/win32/api/oleauto/nf-oleauto-sysfreestring) and other `BSTR` APIs when appropriate. The `_bstr_t` class uses reference counting to avoid excessive overhead.
13+
14+
## Members
1415

1516
### Construction
1617

1718
| Constructor | Description |
1819
|--|--|
19-
| [_bstr_t](../cpp/bstr-t-bstr-t.md) | Constructs a `_bstr_t` object. |
20+
| [`_bstr_t`](../cpp/bstr-t-bstr-t.md) | Constructs a `_bstr_t` object. |
2021

2122
### Operations
2223

2324
| Function | Description |
2425
|--|--|
25-
| [Assign](../cpp/bstr-t-assign.md) | Copies a `BSTR` into the `BSTR` wrapped by a `_bstr_t`. |
26-
| [Attach](../cpp/bstr-t-attach.md) | Links a `_bstr_t` wrapper to a `BSTR`. |
27-
| [copy](../cpp/bstr-t-copy.md) | Constructs a copy of the encapsulated `BSTR`. |
28-
| [Detach](../cpp/bstr-t-detach.md) | Returns the `BSTR` wrapped by a `_bstr_t` and detaches the `BSTR` from the `_bstr_t`. |
29-
| [GetAddress](../cpp/bstr-t-getaddress.md) | Points to the `BSTR` wrapped by a `_bstr_t`. |
30-
| [GetBSTR](../cpp/bstr-t-getbstr.md) | Points to the beginning of the `BSTR` wrapped by the `_bstr_t`. |
31-
| [length](../cpp/bstr-t-length.md) | Returns the number of characters in the `_bstr_t`. |
26+
| [`Assign`](../cpp/bstr-t-assign.md) | Copies a `BSTR` into the `BSTR` wrapped by a `_bstr_t`. |
27+
| [`Attach`](../cpp/bstr-t-attach.md) | Links a `_bstr_t` wrapper to a `BSTR`. |
28+
| [`copy`](../cpp/bstr-t-copy.md) | Constructs a copy of the encapsulated `BSTR`. |
29+
| [`Detach`](../cpp/bstr-t-detach.md) | Returns the `BSTR` wrapped by a `_bstr_t` and detaches the `BSTR` from the `_bstr_t`. |
30+
| [`GetAddress`](../cpp/bstr-t-getaddress.md) | Points to the `BSTR` wrapped by a `_bstr_t`. |
31+
| [`GetBSTR`](../cpp/bstr-t-getbstr.md) | Points to the beginning of the `BSTR` wrapped by the `_bstr_t`. |
32+
| [`length`](../cpp/bstr-t-length.md) | Returns the number of characters in the `_bstr_t`. |
3233

3334
### Operators
3435

3536
| Operator | Description |
3637
|--|--|
37-
| [operator =](../cpp/bstr-t-operator-equal.md) | Assigns a new value to an existing `_bstr_t` object. |
38-
| [operator +=](../cpp/bstr-t-operator-add-equal-plus.md) | Appends characters to the end of the `_bstr_t` object. |
39-
| [operator +](../cpp/bstr-t-operator-add-equal-plus.md) | Concatenates two strings. |
40-
| [operator !](../cpp/bstr-t-operator-logical-not.md) | Checks if the encapsulated `BSTR` is a NULL string. |
41-
| [operator ==, !=, \<, >, \<=, >=](../cpp/bstr-t-relational-operators.md) | Compares two `_bstr_t` objects. |
42-
| [operator wchar_t* &#124; char\*](../cpp/bstr-t-wchar-t-star-bstr-t-char-star.md) | Extract the pointers to the encapsulated Unicode or multibyte `BSTR` object. |
38+
| [`operator =`](../cpp/bstr-t-operator-equal.md) | Assigns a new value to an existing `_bstr_t` object. |
39+
| [`operator +=`](../cpp/bstr-t-operator-add-equal-plus.md) | Appends characters to the end of the `_bstr_t` object. |
40+
| [`operator +`](../cpp/bstr-t-operator-add-equal-plus.md) | Concatenates two strings. |
41+
| [`operator !`](../cpp/bstr-t-operator-logical-not.md) | Checks if the encapsulated `BSTR` is a NULL string. |
42+
| [`operator ==`](../cpp/bstr-t-relational-operators.md)<br/>[`operator !=`](../cpp/bstr-t-relational-operators.md)<br/>[`operator <`](../cpp/bstr-t-relational-operators.md)<br/>[`operator >`](../cpp/bstr-t-relational-operators.md)<br/>[`operator <=`](../cpp/bstr-t-relational-operators.md)<br/>[`operator >=`](../cpp/bstr-t-relational-operators.md) | Compares two `_bstr_t` objects. |
43+
| [`operator wchar_t*`](../cpp/bstr-t-wchar-t-star-bstr-t-char-star.md)<br/>[`operator char*`](../cpp/bstr-t-wchar-t-star-bstr-t-char-star.md) | Extract the pointers to the encapsulated Unicode or multibyte `BSTR` object. |
4344

4445
**END Microsoft Specific**
4546

4647
## Requirements
4748

4849
**Header:** \<comutil.h>
4950

50-
**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)
51+
**Lib:** *`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))
5152

5253
## See also
5354

54-
[Compiler COM Support Classes](../cpp/compiler-com-support-classes.md)
55+
[Compiler COM support classes](../cpp/compiler-com-support-classes.md)

docs/cpp/bstr-t-copy.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
---
22
description: "Learn more about: _bstr_t::copy"
33
title: "_bstr_t::copy"
4-
ms.date: "11/04/2016"
4+
ms.date: 02/02/2021
55
f1_keywords: ["_bstr_t::copy"]
66
helpviewer_keywords: ["Copy method [C++]", "BSTR object [C++], copy"]
7-
ms.assetid: 00ba7311-e82e-4a79-8106-5329fa2f869a
87
---
9-
# _bstr_t::copy
8+
# `_bstr_t::copy`
109

1110
**Microsoft Specific**
1211

1312
Constructs a copy of the encapsulated `BSTR`.
1413

1514
## Syntax
1615

17-
```
16+
```cpp
1817
BSTR copy( bool fCopy = true ) const;
1918
```
2019
21-
#### Parameters
20+
### Parameters
2221
23-
*fCopy*<br/>
24-
If **`true`**, **copy** returns a copy of the contained `BSTR`, otherwise **copy** returns the actual BSTR.
22+
*`fCopy`*\
23+
If **`true`**, **`copy`** returns a copy of the contained `BSTR`, otherwise **`copy`** returns the actual `BSTR`.
2524
2625
## Remarks
2726
28-
Returns a newly allocated copy of the encapsulated `BSTR` object.
27+
Returns a newly allocated copy of the encapsulated `BSTR` object, or the encapsulated object itself, depending on the parameter.
2928
3029
## Example
3130
@@ -39,4 +38,4 @@ STDMETHODIMP CAlertMsg::get_ConnectionStr(BSTR *pVal){ // m_bsConStr is _bstr_t
3938

4039
## See also
4140

42-
[_bstr_t Class](../cpp/bstr-t-class.md)
41+
[`_bstr_t` class](../cpp/bstr-t-class.md)

docs/cpp/bstr-t-detach.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
---
22
description: "Learn more about: _bstr_t::Detach"
33
title: "_bstr_t::Detach"
4-
ms.date: "11/04/2016"
4+
ms.date: 02/02/2021
55
f1_keywords: ["_bstr_t::Detach"]
66
helpviewer_keywords: ["Detach method [C++]"]
7-
ms.assetid: cc8284bd-f68b-4fff-b2e6-ce8354dabf8b
87
---
9-
# _bstr_t::Detach
8+
# `_bstr_t::Detach`
109

1110
**Microsoft Specific**
1211

1312
Returns the `BSTR` wrapped by a `_bstr_t` and detaches the `BSTR` from the `_bstr_t`.
1413

1514
## Syntax
1615

17-
```
16+
```cpp
1817
BSTR Detach( ) throw;
1918
```
2019
2120
## Return Value
2221
23-
The `BSTR` wrapped by the `_bstr_t`.
22+
Returns the `BSTR` encapsulated by the `_bstr_t`.
2423
2524
## Example
2625
27-
See [_bstr_t::Assign](../cpp/bstr-t-assign.md) for a example using **Detach**.
26+
See [`_bstr_t::Assign`](../cpp/bstr-t-assign.md) for an example that uses **`Detach`**.
2827
2928
**END Microsoft Specific**
3029
3130
## See also
3231
33-
[_bstr_t Class](../cpp/bstr-t-class.md)
32+
[`_bstr_t` class](../cpp/bstr-t-class.md)

docs/cpp/bstr-t-getaddress.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
22
description: "Learn more about: _bstr_t::GetAddress"
33
title: "_bstr_t::GetAddress"
4-
ms.date: "11/04/2016"
4+
ms.date: 02/02/2021
55
f1_keywords: ["_bstr_t::GetAddress"]
66
helpviewer_keywords: ["GetAddress method [C++]"]
7-
ms.assetid: 09bc9180-867e-4ee5-b22a-8339dc663142
87
---
9-
# _bstr_t::GetAddress
8+
# `_bstr_t::GetAddress`
109

1110
**Microsoft Specific**
1211

1312
Frees any existing string and returns the address of a newly allocated string.
1413

1514
## Syntax
1615

17-
```
16+
```cpp
1817
BSTR* GetAddress( );
1918
```
2019
@@ -24,14 +23,14 @@ A pointer to the `BSTR` wrapped by the `_bstr_t`.
2423
2524
## Remarks
2625
27-
**GetAddress** affects all `_bstr_t` objects that share a `BSTR`. More than one `_bstr_t` can share a `BSTR` through the use of the copy constructor and **operator=**.
26+
**`GetAddress`** affects all `_bstr_t` objects that share a `BSTR`. More than one `_bstr_t` can share a `BSTR` through the use of the copy constructor and **`operator=`**.
2827
2928
## Example
3029
31-
See [_bstr_t::Assign](../cpp/bstr-t-assign.md) for a example using **GetAddress**.
30+
See [`_bstr_t::Assign`](../cpp/bstr-t-assign.md) for an example that uses **`GetAddress`**.
3231
3332
**END Microsoft Specific**
3433
3534
## See also
3635
37-
[_bstr_t Class](../cpp/bstr-t-class.md)
36+
[`_bstr_t` class](../cpp/bstr-t-class.md)

0 commit comments

Comments
 (0)