Registers a delegate that is called when an instance of a managed type, that extends from an unmanaged type, needs to allocate the aggregated unmanaged object.
[Visual Basic]
Public Shared Sub RegisterObjectCreationCallback( _
ByVal callback As ObjectCreationDelegate _
)
[C#]
public static void RegisterObjectCreationCallback(
ObjectCreationDelegate callback
);
[C++]
public: static void RegisterObjectCreationCallback(
ObjectCreationDelegate* callback
);
[JScript]
public static function RegisterObjectCreationCallback(
callback : ObjectCreationDelegate
);
Parameters
- callback
- A delegate that is called in place of CoCreateInstance.
Remarks
This delegate allocates and aggregates the unmanaged object and is called in place of CoCreateInstance. This delegate must be registered in the context of the static (Shared in Visual Basic) class initializer for which the callbacks will be made.
Only one class in an hierarchy should register a delegate callback.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
ExtensibleClassFactory Class | ExtensibleClassFactory Members | System.Runtime.InteropServices Namespace