Enumerates the members of the object.
HRESULT GetNextDispID( DWORD grfdex, DISPID id, DISPID *pid );
Returns one of the following values:
S_OK | Success. |
S_FALSE | Enumeration is done. |
Value | Meaning |
---|---|
fdexEnumDefault | Requests that the object enumerates the default elements. The object is allowed to enumerate any set of elements. |
fdexEnumAll | Requests that the object enumerates all of the elements. The object is allowed to enumerate any set of elements. |
If a member is deleted by DeleteMemberByName or DeleteMemberByDispID, the DISPID needs to remain valid for GetNextDispID.
HRESULT hr; BSTR bstrName; DISPID dispid; IDispatch *pdex; // Assign to pdex hr = pdex->GetNextDispID(
fdexEnumAll, DISPID_STARTENUM, &dispid)
; while (hr != S_FALSE) { pdex->GetMemberName(dispid, &bstrName); if (!wcscmp(bstrName, OLESTR("Bar"))) return TRUE; SysFreeString(bstrName); hr = pdexObj->GetNextDispID(fdexEnumAll, dispid, &dispid); }
IDispatchEx Interface | IDispatchEx::GetDispID | IDispatchEx::GetNextDispID | IDispatchEx::DeleteMemberByName | IDispatchEx::DeleteMemberByDispID