CreateAggregatedObject(T) Method (IntPtr, T)

Marshal.CreateAggregatedObject<'T> Method (IntPtr, 'T)


[Supported in the .NET Framework 4.5.1 and later versions]

Aggregates a managed object of the specified type with the specified COM object.

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

static member CreateAggregatedObject<'T> : 
        pOuter:nativeint *
        o:'T -> nativeint


Type: System.IntPtr

The outer IUnknown pointer.

Type: T

The managed object to aggregate.

Return Value

Type: System.IntPtr

The inner IUnknown pointer of the managed object.

Type Parameters


The type of the managed object to aggregate.

Exception Condition

o is a Windows Runtime object.

TheCreateAggregatedObject<'T> method aggregates the inner managed pointer of a managed object of a specified type with the specified outer pointer, and returns an inner IUnknown pointer of the managed object.


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

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft