Share via


TBoundProperty<BSTR> (Compact 7)

3/12/2014

This C++ template class represents a property that is a text string of type BSTR.

Syntax

class TBoundProperty<BSTR> : public TBoundPropertyBase<BSTR, ce::auto_bstr>

Inheritance Hierarchy

TBoundPropertyBase<PropertyType,StoreType>

     TBoundProperty<BSTR>

Parameters

  • BSTR
    Property type. For a TBoundProperty<BSTR> object, the value of this parameter is always BSTR.

Members

The following tables list any methods and overloaded operators for this class.

Methods

Method Description

TBoundProperty<BSTR>.Get

Returns the string value that is encapsulated by the TBoundProperty<BSTR> object.

TBoundProperty<BSTR>.Get(XRValue *)

Obtains the XRValue object that encapsulates the string value of the property.

TBoundProperty<BSTR>.Set(const BSTR)

Sets a new value for the string property that is encapsulated by the TBoundProperty<BSTR> object.

TBoundProperty<BSTR>.Set(XRValue *)

Sets the value of the string property that is encapsulated by the TBoundProperty<BSTR> object by using an XRValue object.

Overloaded Operators

Overloaded Operator Description

TBoundProperty<BSTR>.operator&

Returns the address of a binary string that contains the value of the operand on the right in a C++ expression.

TBoundProperty<BSTR>.operator<(TBoundProperty&)

Determines whether a binary string in a TBoundProperty<BSTR> object is less than a binary string in another TBoundProperty<BSTR> object in a C++ expression.

TBoundProperty<BSTR>.operator<=(TBoundProperty&)

Determines whether a binary string in a TBoundProperty<BSTR> object is less than or equal to a binary string in another TBoundProperty<BSTR> object in a C++ expression.

TBoundProperty<BSTR>.operator>(TBoundProperty&)

Determines whether a binary string in a TBoundProperty<BSTR> object is greater than a binary string in another TBoundProperty<BSTR> object in a C++ expression.

TBoundProperty<BSTR>.operator>=(TBoundProperty&)

Determines whether a binary string in a TBoundProperty<BSTR> object is greater than or equal to a binary string in another TBoundProperty<BSTR> object in a C++ expression.

TBoundProperty<BSTR>.operator==(TBoundProperty&)

Determines whether two binary strings in two TBoundProperty<BSTR> objects are equal to each other.

TBoundProperty<BSTR>.operator!=(TBoundProperty&)

Determines whether two binary strings in two TBoundProperty<BSTR> objects are different.

TBoundProperty<BSTR>.operator BSTR()

Returns the string value in the TBoundProperty<BSTR> object.

TBoundProperty<BSTR>.operator<(BSTR)

Determines whether a binary string in a TBoundProperty<BSTR> object is less than another binary string in a C++ expression.

TBoundProperty<BSTR>.operator<=(BSTR)

Determines whether a binary string in a TBoundProperty<BSTR> object is less than or equal to another binary string in a C++ expression.

TBoundProperty<BSTR>.operator>(BSTR)

Determines whether a binary string in a TBoundProperty<BSTR> object is greater than another binary string in a C++ expression.

TBoundProperty<BSTR>.operator>=(BSTR)

Determines whether a binary string in a TBoundProperty<BSTR> object is greater than or equal to another binary string in a C++ expression.

TBoundProperty<BSTR>.operator=(const BSTR)

Assigns the value of a binary string and encapsulates it in a TBoundProperty<BSTR> object.

TBoundProperty<BSTR>.operator==(BSTR)

Determines whether a binary string in a TBoundProperty<BSTR> object and another binary string are equal in a C++ expression.

TBoundProperty<BSTR>.operator!=(BSTR)

Determines whether a binary string in a TBoundProperty<BSTR> object and another binary string are different.

Thread Safety

Members of this class are not thread safe when you obtain or set its property value by using its methods. When you access the value of a property, implement single threading and block other operations until the property update is complete. For example, use XRAutoCriticalSection.

Remarks

The TBoundProperty<BSTR> class provides overloaded operators that you can use in C++ expressions. With overloaded operators, you can contrast two TBoundProperty<BSTR> objects that contain binary strings. You can also use overloaded operators to implicitly convert a TBoundProperty<BSTR> object to a BSTR or obtain the address of a BSTR in memory.

You can use TBoundProperty<BSTR> to represent a data source property that is a character string.

You must call SysAllocString to initialize a value for the text string before you encapsulate it in a TBoundProperty<BSTR> object. When a TBoundProperty<BSTR> object is released, the text string resource is automatically deallocated, and it is not necessary to call SysFreeString.

By using a TBoundProperty<BSTR> object to represent a data source property, you can register the TBoundProperty<BSTR> object with a TPropertyBag<Derived> object. Then, applications can use TPropertyBag.GetValue(const WCHAR *,XRValue *) and TPropertyBag.SetValue(const WCHAR *,XRValue *) to access and modify the property by specifying its name. To populate a UI element with the value of the property, specify the property name in a Binding Markup Extension or by calling IXRFrameworkElement::SetBinding.

Requirements

Header

oleauto.h,
XRPropertyBag.h

Library

oleaut32.lib

See Also

Reference

Classes for Populating UI Elements with Data
TBoundPropertyBase<PropertyType,StoreType>
IXRTextBox::SetText
IXRTextBlock::SetText