IEnumCERTVIEWCOLUMN::GetValue

[This is preliminary documentation and subject to change.]

The GetValue method retrieves the data value contained in the column.

[VB] Variant GetValue(
  Long Flags
);
 
[JAVA] com.ms.Variant GetValue(
  int Flags
);
 
[C++] HRESULT GetValue(
  LONG Flags,         // in
  VARIANT *pvarValue  // out
);
 

Parameters

Flags
Identifier that denotes the output format for the data stored in pvarValue. This can be one of the following values.
Flag Meaning
CV_OUT_BASE64HEADER BASE64 with begin/end
CV_OUT_BASE64 BASE64 without begin/end
CV_OUT_BINARY binary
CV_OUT_BASE64REQUESTHEADER BASE64 with begin/end
CV_OUT_HEX hex string
CV_OUT_HEXASCII hex string with Ascii+address

[C++] pvarValue
Pointer to value of VARIANT type that will receive the data in the Certificate Server view's column. This function will fail if pvarValue is NULL. Upon successful completion of this function, pvarValue will point to a value of VARIANT type that will contain the data in the Certificate Server view's column. GetValue calls VariantClear on pvarValue, so in loop conditions the caller need not call VariantClear prior to calling GetValue. The caller is responsible for calling VariantInit before pvarValue is first used as a parameter by GetValue; the caller is also responsible for calling VariantClear when done with pvarValue (such as prior to exiting a function).

Return Values

[VB][JAVA] The return value is a Variant representing the data in the column.

[C++] The return value is an HRESULT. A value of S_OK indicates success.

Remarks

This function is used to retrieve the data in the column currently being referenced by the IEnumCERTVIEWCOLUMN object.

If the IEnumCERTVIEWCOLUMN object is not referencing a valid column, GetValue will fail. Use the IEnumCERTVIEWCOLUMN Next method to reference a valid column.

Example

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("%S\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 );
 

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

IEnumCERTVIEWCOLUMN::GetName, IEnumCERTVIEWCOLUMN::GetType