ObjectCreationDelegate 委托

定义

创建 COM 对象。Creates a COM object.

public delegate IntPtr ObjectCreationDelegate(IntPtr aggregator);
[System.Runtime.InteropServices.ComVisible(true)]
public delegate IntPtr ObjectCreationDelegate(IntPtr aggregator);
type ObjectCreationDelegate = delegate of nativeint -> nativeint
Public Delegate Function ObjectCreationDelegate(aggregator As IntPtr) As IntPtr 

参数

aggregator
IntPtr

指向托管对象的 IUnknown 接口的指针。A pointer to the managed object's IUnknown interface.

返回值

IntPtr

表示 COM 对象的 IUnknown 接口的 IntPtr 对象。An IntPtr object that represents the IUnknown interface of the COM object.

继承
ObjectCreationDelegate
属性

注解

CoCreateInstance当托管对象需要创建其非托管部分的新实例时, 调用此委托以创建 COM 对象作为替代方法。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. 托管对象的IUnknown 接口作为参数传递,并且委托应返回非托管IUnknown对象的接口。The IUnknown interface of the managed object is passed as a parameter and the delegate should return the IUnknown interface of the unmanaged object. 这两个接口都作为IntPtr类型进行传递, 以避免封送处理。Both interfaces are passed as type IntPtr to avoid marshaling.

InvokeDelegate 的每个派生类都有一个构造函数和一个方法。MulticastDelegateEvery derived class of Delegate and MulticastDelegate has a constructor and an Invoke method.

扩展方法

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于