Interface IDispatchProvider
- Namespace
- CsCom.Runtime
- Assembly
- CsCom.Runtime.dll
Implemented by the objects that wrap an IDispatch interface: the late-bound dispinterface wrappers and
the dynamic objects. The marshallers pass the wrapped interface instead of the wrapper.
public interface IDispatchProvider
Remarks
A late-bound or dynamic wrapper, which is not exposed to COM itself (see
IsExposedToCom(object?)), stands for the COM object of its Dispatch everywhere:
the support code passes that object instead of the wrapper, in a VARIANT, a SAFEARRAY and an
interface parameter alike, also of a COM interface that the wrapper implements itself, which that object is asked
for, FromObject(object?, bool) enumerates it, and
Release(object?) releases it. A wrapper whose Dispatch is null,
against the contract, stands for no object, like null: it is converted to null,
and rejected where an object is required. A wrapper whose Dispatch is an object of the application
that is exposed to COM, e.g. a decorator that a call returned, stands for that object, with its rule below.
An object of the application that is exposed to COM is passed itself, also when it implements this interface, so
that its pointer converts back to it, and it is never released. It stands for the COM object of its
Dispatch only where an interface is required that it does not implement: IDispatch in a
SAFEARRAY of IDispatch, in a dispinterface wrapper and for dynamic, the interface of a
conversion of a late-bound wrapper, a SAFEARRAY or an event argument, that of a parameter that a late-bound
wrapper of the object is passed to, IEnumVARIANT in FromObject(object?, bool), and
the source of events. A conversion to an interface asks its COM interface first, as its pointer would be asked, e.g.
for another declaration of the interface that its class implements. One whose Dispatch is
null provides none, and does not implement the interface there.
Properties
Dispatch
Gets the wrapped IDispatch interface.
IDispatch Dispatch { get; }