ComObject.createInstance

Creates and default-initializes a single object of the class specified.

  1. HRESULT createInstance(I target, CLSCTX context, IUnknown outer)
    class ComObject
    extern (D) @nogc static
    HRESULT
    createInstance
    (
    T
    I = IUnknown
    )
    (
    ref I target
    ,
    CLSCTX context = CLSCTX_INPROC
    ,
    IUnknown outer = null
    )
    if (
    is(T == class) &&
    is(I == interface)
    &&
    is(T : IUnknown)
    &&
    is(I : IUnknown)
    )
  2. HRESULT createInstance(inout(T)[] progID, I target, ComClassContext context, IUnknown outer)

Parameters

target I

The target interface to put the class instance into.

context CLSCTX

The context in which the class will be instantiated.

outer IUnknown

The outer class instance that this instance should be instantiated within, or null if it's not an aggregate COM Object.

Return Value

Type: HRESULT

HRESULT describing whether the operation succeeded. Check against S_OK.

Meta