Marshal.CreateAggregatedObject Method

Definition

Overloads

CreateAggregatedObject(IntPtr, Object)
Obsolete.

Aggregates a managed object with the specified COM object.

CreateAggregatedObject<T>(IntPtr, T)

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

CreateAggregatedObject(IntPtr, Object)

Source:
Marshal.NoCom.cs
Source:
Marshal.NoCom.cs
Source:
Marshal.NoCom.cs

Caution

CreateAggregatedObject(IntPtr, Object) may be unavailable in future releases. Instead, use CreateAggregatedObject<T>(IntPtr, T). For more info, go to http://go.microsoft.com/fwlink/?LinkID=296518

Aggregates a managed object with the specified COM object.

C#
[System.Obsolete("CreateAggregatedObject(IntPtr, Object) may be unavailable in future releases. Instead, use CreateAggregatedObject<T>(IntPtr, T). For more info, go to http://go.microsoft.com/fwlink/?LinkID=296518")]
[System.Security.SecurityCritical]
public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o);
C#
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o);
C#
[System.Security.SecurityCritical]
public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o);
C#
public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o);

Parameters

pOuter
IntPtr

The outer IUnknown pointer.

o
Object

An object to aggregate.

Returns

IntPtr

The inner IUnknown pointer of the managed object.

Attributes

Exceptions

o is a Windows Runtime object.

Remarks

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.

Applies to

.NET 9 and other versions
Product Versions (Obsolete)
.NET Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 (Core 1.0)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 2.0, 2.1 (1.2, 1.3, 1.4, 1.5, 1.6)
UWP (10.0)

CreateAggregatedObject<T>(IntPtr, T)

Source:
Marshal.NoCom.cs
Source:
Marshal.NoCom.cs
Source:
Marshal.NoCom.cs

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

C#
[System.Security.SecurityCritical]
public static IntPtr CreateAggregatedObject<T>(IntPtr pOuter, T o);
C#
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static IntPtr CreateAggregatedObject<T>(IntPtr pOuter, T o);
C#
public static IntPtr CreateAggregatedObject<T>(IntPtr pOuter, T o);

Type Parameters

T

The type of the managed object to aggregate.

Parameters

pOuter
IntPtr

The outer IUnknown pointer.

o
T

The managed object to aggregate.

Returns

IntPtr

The inner IUnknown pointer of the managed object.

Attributes

Exceptions

o is a Windows Runtime object.

Remarks

The CreateAggregatedObject 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.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0