Compartilhar via


HStringReference Class

Represents an HSTRING that is created from an existing string.

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

Reference

Microsoft::WRL::Wrappers Namespace