ICertView::GetColumnIndex

[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
);
 

Parameters

fResultColumn
If this value is TRUE, the view is based on a result set; a value of FALSE means the view is based on the full database schema.
strColumnName
Value representing the nonlocalized name of a column in the view.
[C++] pColumnIndex
Address of variable that will contain the index of the column specified in strColumnName. This function will fail if pColumnIndex is NULL.

Return Values

[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.

Remarks

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).

Example

// 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 ); 

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

ICertView::SetRestriction