ExtensibleClassFactory.RegisterObjectCreationCallback Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
public:
static void RegisterObjectCreationCallback(System::Runtime::InteropServices::ObjectCreationDelegate ^ callback);
public static void RegisterObjectCreationCallback (System.Runtime.InteropServices.ObjectCreationDelegate callback);
static member RegisterObjectCreationCallback : System.Runtime.InteropServices.ObjectCreationDelegate -> unit
Public Shared Sub RegisterObjectCreationCallback (callback As ObjectCreationDelegate)
Parameters
- callback
- ObjectCreationDelegate
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
class initializer for which the callbacks will be made.
Only one class in an hierarchy should register a delegate
callback.