DllGetActivationFactory entry point

Retrieves the activation factory from a DLL that contains activatable Windows Runtime classes.

The Windows Runtime does not provide this function. Implement the DllGetActivationFactory function as a DLL export to publish the activatable Windows Runtime classes that are contained in a DLL.

Syntax

HRESULT WINAPI DllGetActivationFactory(
  _In_  HSTRING            activatableClassId,
  _Out_ IActivationFactory **factory
);

Parameters

  • activatableClassId [in]
    Type: HSTRING

    The class identifier that is associated with an activatable runtime class.

  • factory [out]
    Type: IActivationFactory**

    A pointer to the activation factory that corresponds with the class specified by activatableClassId.

Return value

Type: HRESULT

This entry point can return one of these values.

Return code Description
S_OK

The activation factory was found successfully.

E_NOINTERFACE

The activation factory corresponding to the class specified by activatableClassId was not found in the DLL.

E_INVALIDARG

activatableClassId or factory is NULL.

E_OUTOFMEMORY

The activation factory store for the class specified by activatableClassId could not be populated.

REGDB_E_READREGDB

An error occurred while reading the registration database.

REGDB_E_CLASSNOTREG

The class specified by activatableClassId is not supported.

 

Remarks

Do not call the DllGetActivationFactory function directly. When a runtime class is defined in a DLL, the GetActivationFactory function calls CoLoadLibrary to load the DLL and calls the exported DllGetActivationFactory entry point.

The PFNGETACTIVATIONFACTORY type defines a pointer to this function.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

Winrt.h

See also

CoLoadLibrary