ActivationFactory クラス
Windows のランタイムがアクティブになる一つ以上のクラスを有効にします。
template <
typename I0 = Details::Nil,
typename I1 = Details::Nil,
typename I2 = Details::Nil
>
class ActivationFactory : public Details::RuntimeClass<typename Details::InterfaceListHelper<IActivationFactory, I0, I1, I2, Details::Nil>::TypeT, RuntimeClassFlags<WinRt | InhibitWeakReference>, false>;
パラメーター
I0
zeroth のインターフェイス。I1
最初のインターフェイス。I2
2 番目のインターフェイス。
解説
ActivationFactory は IActivationFactory のインターフェイスに登録メソッドと基本機能を提供します。ActivationFactory は、カスタムのファクトリを実装することができます。
次のコードは、シンボルで ActivationFactory を使用する方法について説明します。
struct MyClassFactory : public ActivationFactory<IMyAddtionalInterfaceOnFactory>
{
STDMETHOD(ActivateInstance) (_Outptr_result_nullonfailure_ IInspectable** ppvObject)
{
// my custom implementation
return S_OK;
}
};
ActivatableClassWithFactory(MyClass, MyClassFactory);
// or if a default factory is used:
//ActivatableClassWithFactory(MyClass, SimpleActivationFactory);
次のコードは 3 以上のインターフェイス ID を指定するために [実装] の構造を使用する方法を示します。
struct MyFactory : ActivationFactory<Implements<I1, I2, I3>, I4, I5>;
メンバー
パブリック コンストラクター
名前 |
説明 |
---|---|
ActivationFactory のクラスを初期化します。 |
パブリック メソッド
名前 |
説明 |
---|---|
ActivationFactory の現在のオブジェクトの参照カウントをインクリメントします。 |
|
実装されたインターフェイス ID の配列を取得します。 |
|
現在の ActivationFactory をインスタンス化するオブジェクトのランタイム クラス名を取得します。 |
|
現在の ActivationFactory をインスタンス化するオブジェクトの信頼レベルを取得します。 |
|
特定のインターフェイスへのポインターを取得します。 |
|
ActivationFactory の現在のオブジェクトの参照カウントをデクリメントします。 |
継承階層
I0
ChainInterfaces
I0
RuntimeClassBase
ImplementsHelper
DontUseNewUseMake
RuntimeClassFlags
RuntimeClassBaseT
RuntimeClass
ActivationFactory
必要条件
ヘッダー: module.h
名前空間: Microsoft::WRL