Home

IDispatchEx

IDispatchEx is a COM interface that extends the standard IDispatch interface to provide enhanced dynamic dispatch capabilities for automation objects. It is designed to support languages and hosts that expose or modify their members at run time, offering more flexible and predictable access to properties and methods than plain IDispatch alone. Objects that implement IDispatchEx can present new members on the fly, enumerate available members, and control how members are discovered and invoked.

Key capabilities include mapping member names to dispatch IDs (via GetDispID), invoking members (InvokeEx), retrieving metadata

IDispatchEx is optional; clients should query for the interface using QueryInterface with the IID of IDispatchEx

about
members
(GetMemberName
and
GetMemberProperties),
and
enumerating
members
(GetNextDispID).
It
also
supports
removing
dynamic
members
(DeleteMemberByName
and
DeleteMemberByDispID).
These
features
enable
expando-style
objects
and
more
sophisticated
name-based
access
patterns
that
are
difficult
to
achieve
with
IDispatch
alone.
and
gracefully
fall
back
to
IDispatch
if
the
interface
is
not
supported.
In
practice,
IDispatchEx
is
implemented
by
a
subset
of
COM
objects,
particularly
in
Windows
components
and
scripting
hosts
that
require
dynamic
member
management.
Its
use
is
more
common
in
environments
where
dynamic
languages
or
hosts
interact
with
complex
COM
objects,
rather
than
in
general
automation
scenarios.