Marshal.CreateAggregatedObject Method (IntPtr, Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Aggregates a managed object with the specified COM object.

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

Public Shared Function CreateAggregatedObject (
	pOuter As IntPtr,
	o As Object
) As IntPtr


Type: System.IntPtr

The outer IUnknown pointer.

Type: System.Object

An object to aggregate.

Return Value

Type: System.IntPtr

The inner IUnknown pointer of the managed object.

Exception Condition

o is a Windows Runtime object.

The CreateAggregatedObject method aggregates the inner managed pointer of a managed object with the specified outer pointer, and then 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 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top