[This is preliminary documentation and subject to change.]
The GetColumnIndex method retrieves the zero-based index of a column.
[VB] Long GetColumnIndex(
Long fResultColumn,
String strColumnName
);
[JAVA] int GetColumnIndex(
int fResultColumn,
java.lang.String strColumnName
);
[C++] HRESULT GetColumnIndex(
LONG fResultColumn, // in
BSTR const strColumnName, // in
LONG *pColumnIndex // out
);
[VB][JAVA] The return value is the zero-based index of the column.
[C++] The return value is an HRESULT. A value of S_OK indicates success.
This function is used to determine the index of the view column specified by strColumnName. The column indices are zero-based (the first column is index 0).
// pCertView is pointer to ICertView
LONG index:
BSTR bstrCol = NULL;
HRESULT hr;
bstrCol = SysAllocString(TEXT("RequestID"));
hr = pView->GetColumnIndex( FALSE, bstrCol, &nIndex );
if ( FAILED( hr ) )
{
printf("Failed GetColumnIndex - %x\n", hr );
goto error;
}
printf( "Column %S has index %d\n", bstrCol, nIndex );
// free resource
if ( NULL != bstrCol )
SysFreeString( bstrCol );
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in certview.h.
Import Library: Use certidl.lib.