Home

REFIID

REFIID is a type used in Component Object Model (COM) programming on Windows. It represents a reference to an interface identifier (IID) and is used to specify which interface a caller wants to access.

Definition and typing: In C++, REFIID is defined as a reference to an IID, typically typedef const

Usage: REFIID is most commonly seen as the type of the riid parameter in COM methods such

Relation to IID and GUID: IID stands for Interface Identifier and is defined as a GUID. REFIID

Examples: Well-known IIDs include IID_IUnknown and IID_IDispatch; many COM interfaces define their own IIDs, assigned as

Notes: REFIID is defined in Windows headers such as Objbase.h and OleIdl.h and is a common convention

IID&
REFIID.
In
C,
where
references
do
not
exist,
it
resolves
to
a
pointer
to
a
const
IID,
typically
typedef
const
IID*
REFIID.
The
IID
itself
is
a
GUID
that
uniquely
identifies
a
COM
interface.
as
QueryInterface,
for
example:
HRESULT
QueryInterface(REFIID
riid,
void**
ppvObject).
The
riid
parameter
identifies
the
requested
interface.
The
implementation
checks
the
IID
and,
if
supported,
returns
a
pointer
to
that
interface
through
ppvObject;
otherwise,
it
returns
E_NOINTERFACE.
simply
describes
passing
that
IID
by
reference
(or
by
pointer
in
C)
to
functions,
rather
than
passing
the
IID
by
value.
globally
unique
identifiers
to
ensure
uniqueness
across
components.
across
COM
APIs
for
identifying
interfaces
in
a
type-safe
way.