Table of Contents

Namespace CsCom.Runtime

Classes

ComActivator

Creates instances of COM classes and wraps them using source-generated COM interop.

ComBstr

A BSTR, whose characters are accessed in place rather than copied to a string. It also keeps the exact length in bytes of BSTRs that hold binary data.

ComBstrMarshaller

Marshals ComBstr as BSTR pointers, following the COM ownership rules.

ComBstrMarshaller.ManagedToUnmanagedOut

Receives a string returned by a COM method; the caller owns it.

ComBstrMarshaller.UnmanagedToManagedOut

Returns a string from a COM object implemented in .NET; the caller owns it. An owned string is detached, a view is copied.

ComDispatch

Resolves and invokes the members of IDispatch interfaces by name and dispatch identifier, and reads their type information: the late binding that the generated dispinterface wrappers and dynamic objects build on.

ComDynamic

Gives late-bound access to COM objects through dynamic.

ComEnumerator

Adapts an IEnumVARIANT to IEnumerator<T>, so that COM collections can be used in foreach loops.

ComMarshalling

Configures how the support code converts COM interface pointers to managed objects and back.

ComObjectMarshaller<T>

Marshals COM interfaces with one managed object per COM object, like ComInterfaceMarshaller<T>, and with the StrategyBasedComWrappers of ComWrappers when it is set. The pointer of a managed object that is exposed to COM is converted to that object itself when it implements the interface, and otherwise to a COM object of its own, which calls it through COM, e.g. when its class implements another declaration of the interface: ComInterfaceMarshaller<T> throws an InvalidCastException then. Such a COM object is created for every conversion, like a unique object: it is not shared, so two conversions of the pointer give two objects, and Release(object?) releases it.

ComSafeArrayMarshaller<T>

Marshals ComSafeArray<T> as SAFEARRAY pointers, following the COM ownership rules.

ComSafeArrayMarshaller<T>.ManagedToUnmanagedOut

Receives an array returned by a COM method; the caller owns it.

ComSafeArrayMarshaller<T>.UnmanagedToManagedOut

Returns an array from a COM object implemented in .NET; the caller owns it. An owned array is detached, a view is copied.

ComSafeArray<T>

A SAFEARRAY of any rank whose elements are accessed as T. Unlike the .NET arrays converted from SAFEARRAYs, it keeps the bounds of the native array, e.g. 1-based arrays created by Visual Basic or Excel.

CurrencyMarshaller

Marshals decimal values as OLE Automation currency values (CURRENCY).

DateMarshaller

Marshals DateTime values as OLE Automation dates (DATE).

DispIds

Well-known dispatch identifiers.

DispatchEventSink

An event sink for dispinterfaces: a COM object that implements IDispatch, also under the identifier of the dispinterface, and passes the invocations to an IDispatchEventHandler until the gate of its connection is closed.

DispatchObject

The base class of the late-bound wrappers generated for dispinterfaces.

DispatchWrapperMarshaller<T>

Marshals late-bound dispinterface wrappers as IDispatch pointers, like ComObjectMarshaller<T>.

DynamicDispatchObject

Gives late-bound access to an IDispatch interface through dynamic: members are resolved by name with IDispatch::GetIDsOfNames and invoked with IDispatch::Invoke.

EventConnection

A connection of an event sink to a COM object that raises events through a connection point. Disposing the connection disconnects the sink.

EventGate

The gate of an event connection, which EventConnection creates for each connection and passes to the sink that it connects. The gate is closed once the connection is disconnected, or when it could not be established; a closed sink accepts the events without passing them to its handler.

EventInterface

A source dispinterface of a coclass, through which its objects raise events, see GetEventInterfaces(IDispatch).

EventSubject

The base of EventSubject<T>, which completes the observables of an event sink together.

EventSubject<T>

A minimal hot observable that pushes the values it receives to its subscribers. The event sinks generated with the observable event style expose an EventSubject<T> for each event.

OptionalVariantMarshaller

Marshals optional object parameters as VARIANTs.

SafeArrayMarshaller

Marshals arrays of up to three dimensions as SAFEARRAYs.

SafeArrayMarshaller<T>

Marshals one-dimensional arrays as SAFEARRAYs. Multidimensional SAFEARRAYs are marshalled by SafeArrayMarshaller and ComSafeArrayMarshaller<T>.

UniqueComObjectMarshaller<T>

Marshals COM interfaces with a managed object of its own for every interface pointer, like UniqueComInterfaceMarshaller<T>, and with the StrategyBasedComWrappers of ComWrappers when it is set. The object belongs to its receiver: Release(object?) releases it at once, and it is released when it is garbage collected otherwise. The pointer of a managed object that is exposed to COM is converted to that object itself when it implements the interface, which has nothing to release, and otherwise to a COM object of its own, which calls it through COM.

UniqueDispatchWrapperMarshaller<T>

Marshals late-bound dispinterface wrappers as IDispatch pointers, with a managed object of its own for every pointer, like UniqueComObjectMarshaller<T>.

UnknownSafeArrayMarshaller

Marshals arrays of objects as SAFEARRAYs of IUnknown pointers.

VariantMarshaller

Marshals object values as OLE Automation VARIANTs.

Structs

ComBool

An OLE Automation Boolean value (VARIANT_BOOL). It has the layout of VARIANT_BOOL, so it can be used in blittable structures, and converts implicitly to and from bool.

ComBstrMarshaller.ManagedToUnmanagedIn

Passes a string to a COM method; the caller keeps owning it.

ComBstrMarshaller.ManagedToUnmanagedRef

Passes a string by reference to a COM method, which can replace it. A replaced string was freed by the callee, so its wrapper is detached.

ComBstrMarshaller.UnmanagedToManagedIn

Receives a string passed to a COM object implemented in .NET: a view that is valid during the call.

ComBstrMarshaller.UnmanagedToManagedRef

Receives a string by reference in a COM object implemented in .NET, which can replace it. A replaced string is freed, as the callee of an [in, out] parameter must do.

ComBstrValue

A BSTR stored in a field of a structure. It has the layout of the BSTR pointer, so it can be used in blittable structures, and converts implicitly to string.

ComCurrency

An OLE Automation currency value (CURRENCY). It has the layout of CURRENCY, so it can be used in blittable structures, and converts implicitly to and from decimal.

ComDate

An OLE Automation date (DATE). It has the layout of DATE, so it can be used in blittable structures, and converts implicitly to and from DateTime.

ComSafeArrayMarshaller<T>.ManagedToUnmanagedIn

Passes an array to a COM method; the caller keeps owning it.

ComSafeArrayMarshaller<T>.ManagedToUnmanagedRef

Passes an array by reference to a COM method, which can change it in place or replace it. A replaced array was destroyed by the callee, so its wrapper is detached.

ComSafeArrayMarshaller<T>.UnmanagedToManagedIn

Receives an array passed to a COM object implemented in .NET: a view that is valid during the call.

ComSafeArrayMarshaller<T>.UnmanagedToManagedRef

Receives an array by reference in a COM object implemented in .NET, which can change it in place or replace it. A replaced array is destroyed, as the callee of an [in, out] parameter must do.

DispParams

The OLE Automation DISPPARAMS structure.

EventArguments

The arguments of an invocation of IDispatch::Invoke (DISPPARAMS) and its result.

EventMember

An event (a method of a source dispinterface) of a COM object, see GetEventInterfaces(IDispatch).

ExcepInfo

The OLE Automation EXCEPINFO structure.

Interfaces

IConnectionPoint

The COM IConnectionPoint interface, through which the sinks of an event interface are connected.

IConnectionPointContainer

The COM IConnectionPointContainer interface, implemented by the objects that raise events.

IDispatch

The OLE Automation IDispatch interface. Dual interfaces derive from it so that their vtable slots line up.

IDispatchEventHandler

Handles the events that a COM object raises through IDispatch::Invoke.

IDispatchProvider

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.

IDispatchWrapper<TSelf>

Implemented by the late-bound wrappers generated for dispinterfaces.

IEnumVARIANT

The OLE Automation IEnumVARIANT interface returned by _NewEnum members of collections.

IProvideClassInfo

The COM IProvideClassInfo interface, through which an object gives the type information of its coclass, including its event interfaces.

Enums

ClassContext

The execution contexts in which a COM class can be activated (CLSCTX).

DispatchArgumentKind

How an argument of Invoke(IDispatch, int, DispatchFlags, ReadOnlySpan<object?>, ReadOnlySpan<int>, Span<object?>, ReadOnlySpan<DispatchArgumentKind>, string?) is passed.

DispatchFlags

The kind of an Invoke(int, in Guid, uint, ushort, DispParams*, ComVariant*, ExcepInfo*, uint*) call.

DispatchMemberKinds

How the type information of an object describes a member, see GetMemberKinds(IDispatch, int).