ActivationFactory Class

 

Enables one or more classes to be activated by the Windows Runtime.

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>;  

Parameters

I0
The zeroth interface.

I1
The first interface.

I2
The second interface.

ActivationFactory provides registration methods and basic functionality for the IActivationFactory interface. ActivationFactory also enables you to provide a custom factory implementation.

The following code fragment symbolically illustrates how to use 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);

The following code fragment shows how to use the Implements structure to specify more than three interface IDs.

struct MyFactory : ActivationFactory<Implements<I1, I2, I3>, I4, I5>;

Public Constructors

NameDescription
ActivationFactory::ActivationFactory ConstructorInitializes the ActivationFactory class.

Public Methods

NameDescription
ActivationFactory::AddRef MethodIncrements the reference count of the current ActivationFactory object.
ActivationFactory::GetIids MethodRetrieves an array of implemented interface IDs.
ActivationFactory::GetRuntimeClassName MethodGets the runtime class name of the object that the current ActivationFactory instantiates.
ActivationFactory::GetTrustLevel MethodGets the trust level of the object that the current ActivationFactory instantiates.
ActivationFactory::QueryInterface MethodRetrieves a pointer to the specified interface.
ActivationFactory::Release MethodDecrements the reference count of the current ActivationFactory object.

I0

ChainInterfaces

I0

RuntimeClassBase

ImplementsHelper

DontUseNewUseMake

RuntimeClassFlags

RuntimeClassBaseT

RuntimeClass

ActivationFactory

Header: module.h

Namespace: Microsoft::WRL

Microsoft::WRL Namespace

Show: