Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ObjectCreationDelegate Delegate

Creates a COM object.

[Visual Basic]
<Serializable>
Public Delegate Function Sub ObjectCreationDelegate( _
   ByVal aggregator As IntPtr _
) As IntPtr
[C#]
[Serializable]
public delegate IntPtr ObjectCreationDelegate(
   IntPtr aggregator
);
[C++]
[Serializable]
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.

aggregator
A pointer to the managed object's IUnknown interface.

Remarks

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.

Requirements

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

Show:
© 2017 Microsoft