Skip to content

Commit c022fbd

Browse files
author
mikeblome
committed
new getrawbuffer methods fixes #706
1 parent c0fdd99 commit c022fbd

2 files changed

Lines changed: 39 additions & 4 deletions

File tree

docs/cppcx/wrl/hstring-class.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "HString Class"
3-
ms.date: "09/24/2018"
3+
ms.date: "07/15/2019"
44
ms.topic: "reference"
5-
f1_keywords: ["corewrappers/Microsoft::WRL::Wrappers::HString", "corewrappers/Microsoft::WRL::Wrappers::HString::Attach", "corewrappers/Microsoft::WRL::Wrappers::HString::CopyTo", "corewrappers/Microsoft::WRL::Wrappers::HString::Detach", "corewrappers/Microsoft::WRL::Wrappers::HString::Get", "corewrappers/Microsoft::WRL::Wrappers::HString::GetAddressOf", "corewrappers/Microsoft::WRL::Wrappers::HString::HString", "corewrappers/Microsoft::WRL::Wrappers::HString::IsValid", "corewrappers/Microsoft::WRL::Wrappers::HString::MakeReference", "corewrappers/Microsoft::WRL::Wrappers::HString::operator=", "corewrappers/Microsoft::WRL::Wrappers::HString::operator==", "corewrappers/Microsoft::WRL::Wrappers::HString::operator!=", "corewrappers/Microsoft::WRL::Wrappers::HString::operator<", "corewrappers/Microsoft::WRL::Wrappers::HString::Release", "corewrappers/Microsoft::WRL::Wrappers::HString::Set", "corewrappers/Microsoft::WRL::Wrappers::HString::~HString"]
5+
f1_keywords: ["corewrappers/Microsoft::WRL::Wrappers::HString", "corewrappers/Microsoft::WRL::Wrappers::HString::Attach", "corewrappers/Microsoft::WRL::Wrappers::HString::CopyTo", "corewrappers/Microsoft::WRL::Wrappers::HString::Detach", "corewrappers/Microsoft::WRL::Wrappers::HString::Get", "corewrappers/Microsoft::WRL::Wrappers::HString::GetRawBuffer","corewrappers/Microsoft::WRL::Wrappers::HString::GetAddressOf", "corewrappers/Microsoft::WRL::Wrappers::HString::HString", "corewrappers/Microsoft::WRL::Wrappers::HString::IsValid", "corewrappers/Microsoft::WRL::Wrappers::HString::MakeReference", "corewrappers/Microsoft::WRL::Wrappers::HString::operator=", "corewrappers/Microsoft::WRL::Wrappers::HString::operator==", "corewrappers/Microsoft::WRL::Wrappers::HString::operator!=", "corewrappers/Microsoft::WRL::Wrappers::HString::operator<", "corewrappers/Microsoft::WRL::Wrappers::HString::Release", "corewrappers/Microsoft::WRL::Wrappers::HString::Set", "corewrappers/Microsoft::WRL::Wrappers::HString::~HString"]
66
helpviewer_keywords: ["Microsoft::WRL::Wrappers::HString class", "Microsoft::WRL::Wrappers::HString::Attach method", "Microsoft::WRL::Wrappers::HString::CopyTo method", "Microsoft::WRL::Wrappers::HString::Detach method", "Microsoft::WRL::Wrappers::HString::Get method", "Microsoft::WRL::Wrappers::HString::GetAddressOf method", "Microsoft::WRL::Wrappers::HString::HString, constructor", "Microsoft::WRL::Wrappers::HString::IsValid method", "Microsoft::WRL::Wrappers::HString::MakeReference method", "Microsoft::WRL::Wrappers::HString::operator= operator", "Microsoft::WRL::Wrappers::HString::operator== operator", "Microsoft::WRL::Wrappers::HString::operator!= operator", "Microsoft::WRL::Wrappers::HString::operator< operator", "Microsoft::WRL::Wrappers::HString::Release method", "Microsoft::WRL::Wrappers::HString::Set method", "Microsoft::WRL::Wrappers::HString::~HString, destructor"]
77
ms.assetid: 6709dd2e-8d72-4675-8ec7-1baa7d71854d
88
---
@@ -38,6 +38,7 @@ Name | Description
3838
[HString::Detach](#detach) | Disassociates the specified `HString` object from its underlying value.
3939
[HString::Get](#get) | Retrieves the value of the underlying HSTRING handle.
4040
[HString::GetAddressOf](#getaddressof) | Retrieves a pointer to the underlying HSTRING handle.
41+
[HString::GetRawBuffer](#getrawbuffer) | Retrieves a pointer to the underlying string data.
4142
[HString::IsValid](#isvalid) | Indicates whether the current `HString` object is valid.
4243
[HString::MakeReference](#makereference) | Creates an `HStringReference` object from a specified string parameter.
4344
[HString::Release](#release) | Deletes the underlying string value and intializes the current `HString` object to an empty value.
@@ -144,6 +145,23 @@ A pointer to the underlying HSTRING handle.
144145

145146
After this operation, the string value of the underlying HSTRING handle is destroyed.
146147

148+
## <a name="getrawbuffer"></a>HString::GetRawBuffer
149+
150+
Retrieves a pointer to the underlying string data.
151+
152+
```cpp
153+
const wchar_t* GetRawBuffer(unsigned int* length) const;
154+
```
155+
### Parameters
156+
157+
*length*
158+
Pointer to an **int** variable that receives the length of the data.
159+
160+
### Return Value
161+
162+
A **const** pointer to the underlying string data.
163+
164+
147165
## <a name="hstring"></a>HString::HString
148166
149167
Initializes a new instance of the `HString` class.

docs/cppcx/wrl/hstringreference-class.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "HStringReference Class"
3-
ms.date: "09/25/2018"
3+
ms.date: "07/15/2019"
44
ms.topic: "reference"
5-
f1_keywords: ["corewrappers/Microsoft::WRL::Wrappers::HStringReference", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::CopyTo", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::Get", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::HStringReference", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::operator=", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::operator==", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::operator!=", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::operator<"]
5+
f1_keywords: ["corewrappers/Microsoft::WRL::Wrappers::HStringReference", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::CopyTo", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::Get", "corewrappers/Microsoft::WRL::Wrappers::GetRawBuffer", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::HStringReference", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::operator=", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::operator==", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::operator!=", "corewrappers/Microsoft::WRL::Wrappers::HStringReference::operator<"]
66
helpviewer_keywords: ["Microsoft::WRL::Wrappers::HStringReference class", "Microsoft::WRL::Wrappers::HStringReference::CopyTo method", "Microsoft::WRL::Wrappers::HStringReference::Get method", "Microsoft::WRL::Wrappers::HStringReference::HStringReference, constructor", "Microsoft::WRL::Wrappers::HStringReference::operator= operator", "Microsoft::WRL::Wrappers::HStringReference::operator== operator", "Microsoft::WRL::Wrappers::HStringReference::operator!= operator", "Microsoft::WRL::Wrappers::HStringReference::operator< operator"]
77
ms.assetid: 9bf823b1-17eb-4ac4-8c5d-27d27c7a4150
88
---
@@ -34,6 +34,7 @@ Member | Description
3434
----------------------------------- | ------------------------------------------------------------------
3535
[HStringReference::CopyTo](#copyto) | Copies the current `HStringReference` object to an HSTRING object.
3636
[HStringReference::Get](#get) | Retrieves the value of the underlying HSTRING handle.
37+
[HStringReference::GetRawBuffer](#getrawbuffer) | Retrieves a pointer to the underlying string data.
3738

3839
### Public Operators
3940

@@ -85,6 +86,22 @@ HSTRING Get() const throw()
8586

8687
The value of the underlying HSTRING handle.
8788

89+
## <a name="getrawbuffer"></a>HStringReference::GetRawBuffer
90+
91+
Retrieves a pointer to the underlying string data.
92+
93+
```cpp
94+
const wchar_t* GetRawBuffer(unsigned int* length) const;
95+
```
96+
### Parameters
97+
98+
*length*
99+
Pointer to an **int** variable that receives the length of the data.
100+
101+
### Return Value
102+
103+
A **const** pointer to the underlying string data.
104+
88105
## <a name="hstringreference"></a>HStringReference::HStringReference
89106
90107
Initializes a new instance of the `HStringReference` class.

0 commit comments

Comments
 (0)