Freigeben über


ILocalRegistry3.CreateManagedInstance Method

Definition

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

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

Parameters

codeBase
String

[in] String that contains a URL that is the location of the assembly. Optional: use null if you do not use a URL. For more information, see CodeBase.

assemblyName
String

[in] String that contains the simple, unencrypted name of the assembly.

typeName
String

[in] String that contains the name of the type to create.

riid
Guid

[in] Interface to use to communicate with the object. For example, IID_IClassFactory.

ppvObj
IntPtr

nativeint

[out] Pointer to the interface that is requested in riid. On successful return, ppvObj contains the requested interface pointer. On failure, ppvObj contains null.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

This method is safe to access from any thread.

Applies to