IEnumCERTVIEWCOLUMN::GetValue method (certview.h)

The GetValue method retrieves the data value contained in the current column in the column-enumeration sequence.

Syntax

HRESULT GetValue(
  [in]  LONG    Flags,
  [out] VARIANT *pvarValue
);

Parameters

[in] Flags

An identifier that denotes the output format for the retrieved data. This parameter can be one of the following values.

Value Meaning
CV_OUT_BASE64
BASE64 without BEGIN/END
CV_OUT_BASE64HEADER
BASE64 with BEGIN CERTIFICATE and END CERTIFICATE
CV_OUT_BASE64REQUESTHEADER
BASE64 with BEGIN NEW CERTIFICATE REQUEST and END NEW CERTIFICATE REQUEST
CV_OUT_BASE64X509CRLHEADER
BASE64 with BEGIN X509 CRL and END X509 CRL
CV_OUT_BINARY
Binary
CV_OUT_HEX
Hexadecimal string
CV_OUT_HEXADDR
Hexadecimal string with address/offset
CV_OUT_HEXASCII
Hexadecimal string with ASCII
CV_OUT_HEXASCIIADDR
Hexadecimal string with ASCII and address/offset

[out] pvarValue

A pointer to value of VARIANT type that contains the data column. This method fails if pvarValue is NULL. Upon successful completion of this method, pvarValue contains the data in the column. The caller is responsible for calling VariantClear when done with this data.

Return value

C++

If the method succeeds, the method returns S_OK.

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 Variant that represents the data in the column.

Remarks

This method is used to retrieve the data in the column currently being referenced by the column-enumeration sequence.

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

Examples

HRESULT     hr;
VARIANT     var;
SYSTEMTIME  systime;

VariantInit(&var);

// pEnumCol is previously instantiated IEnumCERTVIEWCOLUMN object
hr = pEnumCol->GetValue(CV_OUT_HEX, &var);
if ( FAILED (hr) )
{
    printf("Failed GetValue - %x\n", hr);
    goto error;
}
switch( var.vt )
{
    case VT_EMPTY:
        printf( "VT_EMPTY\n" );
        break;
    case VT_BSTR:
        printf("%ws\n", var.bstrVal );
        break;
    case VT_DATE:
        VariantTimeToSystemTime( var.date, &systime );
        printf("%d.%d.%d %02d:%02d:%02d\n",
               systime.wMonth,
               systime.wDay,
               systime.wYear,
               systime.wHour,
               systime.wMinute,
               systime.wSecond );
        break;
    case VT_I2:
        printf("%d\n", var.iVal );
        break;
    case VT_I4:
        printf("%d\n", var.lVal );
        break;
    default:
        printf("type is:%i\n", var.vt );
        break;
}
// done processing, clear resources
VariantClear( &var );

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

IEnumCERTVIEWCOLUMN

IEnumCERTVIEWCOLUMN::Next

IEnumCERTVIEWCOLUMN::Reset

IEnumCERTVIEWCOLUMN::Skip