次の方法で共有


XRObject<Base> (Compact 2013)

3/28/2014

This C++ class encapsulates an object, and provides additional functionality that resembles the Component Object Model (COM) for the object when you create an instance.

Syntax

template<typename Base>class XRObject : public Base

Template Parameters

Template parameter

Description

Base

The custom class type for XRObject<Base> object instances.

Members

The following table lists methods that belong to this class.

Methods

Methods

Description

XRObject.AddRef

Adds a reference to the XRObject<Base> object.

XRObject.Release

Releases a reference to the XRObject<Base> object.

XRObject.QueryInterface(const IID&,void * *)

Obtains a specific interface pointer type to the XRObject<Base> object.

XRObject.CreateInstance(XRObject<Base> * *)

Creates an instance of the XRObject<Base> object.

XRObject.CreateInstance(Base * *)

Converts the specified object of type Base into an XRObject<Base> instance that also supports functionality that resembles the COM.

XRObject.CreateInstance(As * *)

Converts the specified object that is a type different from ItemType into an XRObject<Base> instance that also supports functionality that resembles COM.

Thread Safety

Members of this class are thread safe if you previously called IXRApplication::CreateHostFromXaml and supplied the method with an XRWindowCreateParams structure in which AllowsMultipleThreadsAccess is set to true.

Remarks

You can create an instance of an XRObject<Base> and supply a custom class type in the Base template parameter. With XRObject<Base>, you can convert an object that does not support COM into an object instance that supports functionality similar to COM and is interoperable with helper methods that provide functionality similar to COM.

In XAML for Windows Embedded, data source collections are not founded on COM, and derived types use XRObject<Base> to create object instances.

Classes with methods that use this object must implement an interface map by using the BEGIN_QI_MAP and END_QI_MAP macros. An interface map contains a list of interface entries. To add an interface to the interface map, use QI_MAP_INTERFACE(iface). The XRObject<Base> instance created by methods in the class will also support the interfaces you defined in the interface map.

Requirements

Header

XRUnknown.h

See Also

Reference

Classes for Application Management