Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

Marshal.CreateAggregatedObject(Of 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
Assemblies:   System.Runtime.InteropServices (in System.Runtime.InteropServices.dll)
  mscorlib (in mscorlib.dll)

Public Shared Function CreateAggregatedObject(Of T) ( _
	pOuter As IntPtr, _
	o As T _
) As IntPtr

Type Parameters


The type of the managed object to aggregate.


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.


o is a Windows Runtime object.

TheCreateAggregatedObject 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.

.NET Framework

Supported in: 4.6, 4.5.1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

  • SecurityCriticalAttribute 

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

© 2015 Microsoft