CreateActivationFactory 函数

创建为可由 Windows 运行时激活的指定类生成实例的工厂。

语法

template<typename Factory>
   inline HRESULT STDMETHODCALLTYPE CreateActivationFactory(
      _In_ unsigned int *flags,        _In_ const CreatorMap* entry,
      REFIID riid,
   _Outptr_ IUnknown **ppFactory) throw();

参数

flags
一个或多个 RuntimeClassType 枚举值的组合。

entry
指向 CreatorMap 的指针,其中包含有关参数 riid 的初始化和注册信息。

riid
对接口 ID 的引用。

ppFactory
如果此操作成功完成,则为指向激活工厂的指针。

返回值

如果成功,则为 S_OK;否则为指示错误的 HRESULT。

注解

如果模板参数 Factory 未派生自接口 IActivationFactory,则会发出断言错误

要求

标头:module.h

命名空间: Microsoft::WRL

另请参阅

Microsoft::WRL::Wrappers::Details 命名空间