ExtensibleClassFactory.RegisterObjectCreationCallback 方法

定义

delegate注册在托管类型的实例(从非托管类型扩展)需要分配聚合的非托管对象时调用的实例。

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)

参数

callback
ObjectCreationDelegate

调用的 A delegate 代替 CoCreateInstance

注解

这会 delegate 分配并聚合非托管对象,并调用该对象代替 CoCreateInstance。 这 delegate 必须在将为其进行回调的 static 类初始值设定项的上下文中注册。

层次结构中只有一个类应注册 delegate 回调。

适用于