Export (0) Print
Expand All

WindowsRuntimeMarshal::GetActivationFactory Method

.NET Framework 4.5

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Returns an object that implements the activation factory interface for the specified Windows Runtime type.

Namespace:  System.Runtime.InteropServices.WindowsRuntime
Assembly:  mscorlib (in mscorlib.dll)

public:
static IActivationFactory^ GetActivationFactory(
	Type^ type
)

Parameters

type
Type: System::Type

The Windows Runtime type to get the activation factory interface for.

Return Value

Type: System.Runtime.InteropServices.WindowsRuntime::IActivationFactory
An object that implements the activation factory interface.

ExceptionCondition
ArgumentException

type does not represent a Windows Runtime type (that is, belonging to the Windows Runtime itself or defined in a Windows Runtime component).

-or-

The object specified for type was not provided by the common language runtime type system.

ArgumentNullException

type is nullptr.

TypeLoadException

The specified Windows Runtime class is not properly registered. For example, the .winmd file was located, but the Windows Runtime failed to locate the implementation.

In addition to the exceptions in the Exceptions section, any HRESULT other than S_OK that is returned by the underlying factory method will be marshaled as an exception.

.NET Framework

Supported in: 4.5

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft