IDispatchEx::GetNextDispIDIDispatchEx::GetNextDispID*
*



Contents  *



Index  *Topic Contents
*Previous Topic: IDispatchEx::GetNameSpaceParent
*Next Topic: IDispatchEx::InvokeEx

IDispatchEx::GetNextDispID

HRESULT GetNextDispID(
   DWORD grfdex,
   DISPID id,
   DISPID *pid
);

Enumerates the members of the object.

grfdex
Determines which set of item will be enumerated. This can be a combination of the following values:
fdexEnumDefault Request that the object enumerate the default elements. The object is allowed to enumerate any set of elements.
fdexEnumAll Request that the object enumerate all of the elements. The object is allowed to enumerate any set of elements.
id
Identifies the current member. GetNextDispID will retrieve the item in the enumeration after this one. Use GetDispID or a previous call to GetNextDispID to obtain this identifier. Use the DISPID_STARTENUM value to obtain the first identifier of the first item.
pid
Address of a DISPID variable that receives the identifier of the next item in the enumeration.

If a member is deleted by DeleteMemberByName or DeleteMemberByDispID, the DISPID needs to remain valid for GetNextDispID.

Example

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);
   }

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.