IEnumCERTVIEWATTRIBUTE::Next

[This is preliminary documentation and subject to change.]

The Next method positions the IEnumCERTVIEWATTRIBUTE object to the next attribute.

[VB] Long Next();
 
[JAVA] int Next();
 
[C++] HRESULT Next(
  LONG *pIndex  // out
);
 

Parameters

[C++] pIndex
Pointer to variable that will contain the index value of the next attribute being referenced. If there are no more attributes to enumerate, this variable will be set to – 1. This function will fail if pIndex is NULL.

Return Values

[VB][JAVA] The return value is the index value of the next attribute that will be referenced by the IEnumCERTVIEWATTRIBUTE object. If there are no more attributes to enumerate, the return value will be – 1.

[C++] The return value is an HRESULT. A value of S_OK indicates success and that the next attribute is now being referenced by the IEnumCERTVIEWATTRIBUTE object. If there are no more attributes, S_FALSE is returned, and pIndex will point to a value of – 1.

Remarks

Upon successful completion of this function, the IEnumCERTVIEWATTRIBUTE object will reference the next attribute. When the attribute is referenced, the attribute name and value can be accessed through the IEnumCERTVIEWATTRIBUTE methods GetName and GetValue.

Example

LONG                        Index;
HRESULT                     hr;
BSTR                        bstrAttribName = NULL;

// pEnumAttr is previously instantiated IEnumCERTVIEWATTRIBUTE object
while ( S_FALSE != pEnumAttr->Next( &Index ) )
{
    // retrieve the attribute name
    hr = pEnumAttr->GetName( &bstrAttribName );
    if ( FAILED( hr ) )
        printf("Failed GetName -  %x\n", hr );
    else
        printf("Attribute name: %S\n", bstrAttribName );
}

// free resources
if ( NULL != bstrAttribName )
    SysFreeString( bstrAttribName );
 

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in certview.h.
  Import Library: Use certidl.lib.

See Also

IEnumCERTVIEWATTRIBUTE::GetName, IEnumCERTVIEWATTRIBUTE::GetValue, IEnumCERTVIEWATTRIBUTE::Skip, IEnumCERTVIEWATTRIBUTE::Reset