IEnumCERTVIEWEXTENSION::GetValue

[This is preliminary documentation and subject to change.]

The GetValue method retrieves the extension value.

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

Parameters

Type
Data type identifier for the returned data in pvarValue. Use of this flag allows the caller to specify that the extension data be decoded prior to being returned in pvarValue. Type can be one of the following values. (If PROPTYPE_BINARY is specified, the data is not decoded but instead returned in its raw format.).
Data type Meaning
PROPTYPE_BINARY Binary data
PROPTYPE_DATE Date+Time
PROPTYPE_LONG Signed long
PROPTYPE_STRING Unicode String

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 for the currently referenced extension. 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 extension data currently referenced by the IEnumCERTVIEWEXTENSION object. 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.

Return Values

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

[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 extension currently being referenced by the IEnumCERTVIEWEXTENSION object.

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

Example

VARIANT         var;
LONG            Index;
HRESULT         hr;
SYSTEMTIME      systime;

VariantInit( &var );

// Enumerate each extension
// pEnumExt is previously instantiated IEnumCERTVIEWEXTENSION object
while ( S_FALSE != pEnumExt->Next( &Index ) )
{
    hr = pEnumExt->GetValue( CV_OUT_HEX, &var );
    if ( FAILED( hr ))
    {
        printf("Failed GetValue - %x\n", hr );
        break;
    }
    switch( var.vt ) 
    {
        case VT_EMPTY:
            printf( "VT_EMPTY\n" );
            break;
        case VT_BSTR:
            printf("BSTR:%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;
    }
}
// free 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

IEnumCERTVIEWEXTENSION::GetFlags, IEnumCERTVIEWEXTENSION::GetName