IEnumCERTVIEWATTRIBUTE::GetName method (certview.h)

The GetName method retrieves the name of the current attribute in the attribute-enumeration sequence.

Syntax

HRESULT GetName(
  [out] BSTR *pstrOut
);

Parameters

[out] pstrOut

A pointer to a variable of BSTR type that contains the name of the attribute.

Return value

C++

If the method succeeds, the method returns S_OK and the pstrOut parameter contains the name of the attribute.

To use this method, create a variable of BSTR type, set the variable equal to NULL, and pass the address of this variable as pstrOut. When you have finished using the BSTR, free it by calling the SysFreeString function.

If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

VB

The return value is a String that contains the name of the attribute.

Remarks

This method is used to retrieve the name of the attribute currently referenced by the attribute-enumeration sequence.

If the attribute-enumeration sequence is not referencing a valid attribute, GetName will fail. Use one of the following methods to navigate through the enumeration:

Examples

BSTR    bstrAttribName = NULL;

// pEnumAttr is previously instantiated IEnumCERTVIEWATTRIBUTE object
hr = pEnumAttr->GetName(&bstrAttribName);
if (S_OK != hr)
    printf("Failed call to GetName - %x\n", hr);
else
    printf("Attribute name is %ws\n", bstrAttribName );

// free memory when done
if (NULL != bstrAttribName)
    SysFreeString(bstrAttribName);

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header certview.h (include Certsrv.h)
Library Certidl.lib
DLL Certadm.dll

See also

IEnumCERTVIEWATTRIBUTE

IEnumCERTVIEWATTRIBUTE::GetValue

IEnumCERTVIEWATTRIBUTE::Next

IEnumCERTVIEWATTRIBUTE::Reset

IEnumCERTVIEWATTRIBUTE::Skip