This documentation is archived and is not being maintained.

ObjectCreationDelegate Delegate

Creates a COM object.

[Visual Basic]
Public Delegate Function Sub ObjectCreationDelegate( _
   ByVal aggregator As IntPtr _
) As IntPtr
public delegate IntPtr ObjectCreationDelegate(
   IntPtr aggregator
public __gc __delegate IntPtr ObjectCreationDelegate(
   IntPtr aggregator

[JScript] In JScript, you can use the delegates in the .NET Framework, but you cannot define your own.

Parameters [Visual Basic, C#, C++]

The declaration of your callback method must have the same parameters as the ObjectCreationDelegate delegate declaration.

A pointer to the managed object's IUnknown interface.


This delegate is called to create a COM object as an alternative to CoCreateInstance when a managed object needs to create a new instance of its unmanaged portion. The IUnknown of the managed object is passed as a parameter and the delegate should return the IUnknown of the unmanaged object. Both interfaces are passed as type IntPtr to avoid marshaling.

Every derived class of Delegate and MulticastDelegate have a constructor and an Invoke method.


Namespace: System.Runtime.InteropServices

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

System.Runtime.InteropServices Namespace