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.
[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:
- IEnumCERTVIEWCOLUMN::Reset: Moves to the beginning of the enumeration sequence.
- IEnumCERTVIEWCOLUMN::Next: Moves to the next column in the enumeration sequence.
- IEnumCERTVIEWCOLUMN::Skip: Skips a specified number of columns.
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 |