ILocalRegistry3.CreateManagedInstance 方法

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

命名空间:  Microsoft.VisualStudio.Shell.Interop
程序集:  Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)

语法

声明
Function CreateManagedInstance ( _
    codeBase As String, _
    assemblyName As String, _
    typeName As String, _
    ByRef riid As Guid, _
    <OutAttribute> ByRef ppvObj As IntPtr _
) As Integer
int CreateManagedInstance(
    string codeBase,
    string assemblyName,
    string typeName,
    ref Guid riid,
    out IntPtr ppvObj
)

参数

  • codeBase
    类型:System.String
    [in] 字符串包含 URL 是程序集的位置。选项:,则使用 URL,请使用 nullnull 引用(在 Visual Basic 中为 Nothing) 。有关更多信息,请参见 CodeBase
  • assemblyName
    类型:System.String
    [in] 字符串包含程序集的简单,未加密的名称。
  • typeName
    类型:System.String
    [in] 字符串包含类型的名称创建。
  • riid
    类型:System.Guid%
    [in] 使用的接口与对象进行通信。例如, IID_IClassFactory。
  • ppvObj
    类型:System.IntPtr%
    [out] 对 riid请求的接口的指针。在成功返回, ppvObj 包含请求的接口指针。在失败, ppvObj 包含 nullnull 引用(在 Visual Basic 中为 Nothing)。

返回值

类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 objext.idl:

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

.NET Framework 安全性

请参见

参考

ILocalRegistry3 接口

Microsoft.VisualStudio.Shell.Interop 命名空间