Click to Rate and Give Feedback
MSDN
MSDN Library
Collapse All/Expand All Collapse All
This page is specific to
.NET Framework 3.0

Other versions are also available for the following:
Microsoft Windows Script Interfaces
IDispatchEx::GetDispID

Maps a single member name to its corresponding DISPID, which can then be used on subsequent calls to IDispatchEx::InvokeEx.

 HRESULT GetDispID(
   BSTR bstrName,
   DWORD grfdex,
   DISPID *pid
);
bstrName

Passed in name to be mapped.

grfdex

Determines the options for obtaining the member identifier. This can be a combination of the following values:

Value

Meaning

fdexNameCaseSensitive

Requests that the name lookup be done in a case-sensitive manner. May be ignored by object that does not support case-sensitive lookup.

fdexNameEnsure

Requests that the member be created if it does not already exist. The new member should be created with the value VT_EMPTY.

fdexNameImplicit

Indicates that the caller is searching object(s) for a member of a particular name when the base object is not explicitly specified.

fdexNameCaseInsensitive

Requests that the name lookup be done in a case-insensitive manner. May be ignored by object that does not support case-insensitive lookup.

pid

Pointer to caller-allocated location to receive DISPID result. If an error occurs, pid contains DISPID_UNKNOWN.

Returns one of the following values:

S_OK

Success.

E_OUTOFMEMORY

Out of Memory.

DISP_E_UNKNOWNNAME

The name was not known.

GetDispID can be used instead of GetIDsOfNames to obtain the DISPID for a given member.

Because IDispatchEx allows the addition and deletion of members, the set of DISPIDs does not remain constant for the lifetime of an object.

The unused riid parameter in IDispatch::GetIDsOfNames has been removed.

BSTR bstrName;
   DISPID dispid;
   IDispatchEx *pdex; 

   // Assign to pdex and bstrName
   pdex->GetDispID(bstrName, fdexNameCaseSensitive, &dispid);
   // Use dispid
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker