IDispatchEx::GetMemberNameIDispatchEx::GetMemberName*
*Contents  *Index  *Topic Contents
*Previous Topic: IDispatchEx::GetDispID
*Next Topic: IDispatchEx::GetMemberProperties

IDispatchEx::GetMemberName

HRESULT GetMemberName(
   DISPID id,
   BSTR *pbstrName
);

Retrieves the name of a member.

id
Identifies the member. Use GetDispID or GetNextDispID to obtain the dispatch identifier.
pbstrName
Address of a BSTR that receives the name of the member. The calling application is responsible for freeing this value.

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.