共用方式為


ILocalRegistry3.CreateManagedInstance Method

Creates an instance of a managed class and returns a requested interface.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'宣告
Function CreateManagedInstance ( _
    codeBase As String, _
    assemblyName As String, _
    typeName As String, _
    ByRef riid As Guid, _
    <OutAttribute> ByRef ppvObj As IntPtr _
) As Integer
'用途
Dim instance As ILocalRegistry3
Dim codeBase As String
Dim assemblyName As String
Dim typeName As String
Dim riid As Guid
Dim ppvObj As IntPtr
Dim returnValue As Integer

returnValue = instance.CreateManagedInstance(codeBase, _
    assemblyName, typeName, riid, ppvObj)
int CreateManagedInstance(
    string codeBase,
    string assemblyName,
    string typeName,
    ref Guid riid,
    out IntPtr ppvObj
)
int CreateManagedInstance(
    [InAttribute] String^ codeBase, 
    [InAttribute] String^ assemblyName, 
    [InAttribute] String^ typeName, 
    [InAttribute] Guid% riid, 
    [OutAttribute] IntPtr% ppvObj
)
abstract CreateManagedInstance : 
        codeBase:string * 
        assemblyName:string * 
        typeName:string * 
        riid:Guid byref * 
        ppvObj:IntPtr byref -> int 
function CreateManagedInstance(
    codeBase : String, 
    assemblyName : String, 
    typeName : String, 
    riid : Guid, 
    ppvObj : IntPtr
) : int

Parameters

  • codeBase
    Type: System.String
    [in] String that contains a URL that is the location of the assembly. Optional: use nulla null reference (Nothing in Visual Basic) if you do not use a URL. For more information, see CodeBase.
  • assemblyName
    Type: System.String
    [in] String that contains the simple, unencrypted name of the assembly.
  • typeName
    Type: System.String
    [in] String that contains the name of the type to create.
  • riid
    Type: System.Guid%
    [in] Interface to use to communicate with the object. For example, IID_IClassFactory.
  • ppvObj
    Type: System.IntPtr%
    [out] Pointer to the interface that is requested in riid. On successful return, ppvObj contains the requested interface pointer. On failure, ppvObj contains nulla null reference (Nothing in Visual Basic).

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From objext.idl:

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

.NET Framework Security

See Also

Reference

ILocalRegistry3 Interface

ILocalRegistry3 Members

Microsoft.VisualStudio.Shell.Interop Namespace