Share via


HStringReference Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at HStringReference Class.

Represents an HSTRING that is created from an existing string.

Syntax

class HStringReference;  

Remarks

The lifetime of the backing buffer in the new HSTRING is not managed by the Windows Runtime. The caller allocates a source string on the stack frame to avoid a heap allocation and to eliminate the risk of a memory leak. Also, the caller must ensure that source string remains unchanged during the lifetime of the attached HSTRING. For more information, see WindowsCreateStringReference function.

Members

Public Constructors

Name Description
HStringReference::HStringReference Constructor Initializes a new instance of the HStringReference class.

Members

Member Description
HStringReference::CopyTo Method Copies the current HStringReference object to an HSTRING object.
HStringReference::Get Method Retrieves the value of the underlying HSTRING handle.

Public Operators

Name Description
HStringReference::Operator= Operator Moves the value of another HStringReference object to the current HStringReference object.
HStringReference::Operator== Operator Indicates whether the two parameters are equal.
HStringReference::Operator!= Operator Indicates whether the two parameters are not equal.

Inheritance Hierarchy

HStringReference

Requirements

Header: corewrappers.h

Namespace: Microsoft::WRL::Wrappers

See Also

Microsoft::WRL::Wrappers Namespace