ILocalRegistry3.CreateManagedInstance 方法

定义

创建托管类的实例并返回所请求的接口。

public:
 int CreateManagedInstance(System::String ^ codeBase, System::String ^ assemblyName, System::String ^ typeName, Guid % riid, [Runtime::InteropServices::Out] IntPtr % ppvObj);
public int CreateManagedInstance (string codeBase, string assemblyName, string typeName, ref Guid riid, out IntPtr ppvObj);
abstract member CreateManagedInstance : string * string * string * Guid * nativeint -> int
Public Function CreateManagedInstance (codeBase As String, assemblyName As String, typeName As String, ByRef riid As Guid, ByRef ppvObj As IntPtr) As Integer

参数

codeBase
String

中包含作为程序集位置的 URL 的字符串。 可选: null 如果不使用 URL,请使用。 有关详细信息,请参阅 CodeBase

assemblyName
String

中包含程序集的简单的、未加密的名称的字符串。

typeName
String

中包含要创建的类型的名称的字符串。

riid
Guid

中用于与对象通信的接口。 例如,IID_IClassFactory。

ppvObj
IntPtr

nativeint

弄指向在中请求的接口的指针 riid 。 成功返回时, ppvObj 包含请求的接口指针。 失败时,将 ppvObj 包含 null

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

COM 签名

从 objext:

HRESULT ILocalRegistry3::CreateManagedInstance(  
    [in] LPCWSTR codeBase,   
    [in] LPCWSTR assemblyName,   
    [in] LPCWSTR typeName,   
    [in] REFIID riid,   
    [out] void** ppvObj  
);  

适用于