riid, rgszNames, cNames, lcid, rgdispid)
OLECHAR FAR* FAR* rgszNames
unsigned int cNames
DISPID FAR* rgdispid
Maps a single member and an optional set of argument names to a corresponding
set of integer DISPIDs, which may be used on subsequent calls to IDispatch::Invoke
. The dispatch function DispGetIDsOfNames
provides a standard implementation of GetIDsOfNames
Reserved for future use. Must be NULL.
Passed-in array of names to be mapped.
Count of the names to be mapped.
The locale context in which to interpret the names.
Caller-allocated array, each element of which contains an ID corresponding to
one of the names passed in the rgszNames
array. The first element represents the member name; the subsequent elements
represent each of the member's parameters.
The SCODE obtained from the returned HRESULT is one of the following:
||Out of memory.
||One or more of the names were not known.
The returned array of DISPIDs contains DISPID_UNKNOWN for each entry that
corresponds to an unknown name.
||The LCID was not recognized.
implementation may choose to associate any positive integer ID value with a
given name. Zero is reserved for the default, or Value property;
1 is reserved to indicate an unknown name; and other negative values are
defined for other purposes. For example, if GetIDsOfNames
is called and the implementation does not recognize one or more of the names,
it will return DISP_E_UNKNOWNNAME and the rgdispid
array will contain DISPID_UNKNOWN for the entries that correspond to the
The member and parameter DISPIDs must remain constant for the lifetime of the
object. This allows a client to obtain the DISPIDs once and cache them for
is called with more than one name,
the first name (rgszNames
) corresponds to the member name, and subsequent names correspond to the
names of the member's parameters.
The same name may map to different DISPIDs, depending on context. For example,
a name may have a DISPID when it is used as a member name with a particular
interface, a different DISPID as a member of a different interface, and different
mapping for each time it appears as a parameter.
interface binds to names at run time. To bind at compile time instead, an IDispatch
map names to DISPIDs using the type information interfaces described in
Chapter 8, "Type Description Interfaces
." This allows a client to bind to members at compile time and avoid calling GetIDsOfNames
at run time.
The implementation of GetIDsOfNames
must be case insensitive. Clients that need case-sensitive name mapping
should use the type information interfaces to map names to DISPIDs, rather than
The following code from the Lines sample file LINE.CPP implements the GetIDsOfNames
member function for the CLine class. The OLE Automation object uses the
standard implementation, DispGetIDsOfNames
OLECHAR FAR* FAR* rgszNames,
DISPID FAR* rgdispid)
return DispGetIDsOfNames(m_ptinfo, rgszNames, cNames, rgdispid);
The following code might appear in an OLE Automation controller that calls GetIDsOfNames
to get the DISPID of the CLine
IDispatch FAR* pdisp = (IDispatch FAR*)NULL;
OLECHAR FAR* szMember = "color";
// Omitted code that sets pdisp...
hresult = pdisp->GetIDsOfNames(
- Software for developers
Software for Android Developers
- More information resources
Unix Manual Pages