Platform SDK: Active Directory, ADSI, and Directory Services

IDirectorySearch::FreeColumn

The IDirectorySearch::FreeColumn method releases memory that the IDirectorySearch::GetColumn method allocated for data for the column.

HRESULT FreeColumn(
  PADS_SEARCH_COLUMN pSearchColumn 
);

Parameters

pSearchColumn
[in] Provides a pointer to the column to be freed.

Return Values

This method returns the standard return values, as well as the following:

S_OK
The column was freed successfully.
E_ADS_BAD_PARAMETER
The specified column is invalid or contains invalid attributes.

For other return values, see ADSI Error Codes.

Example Code [C++]

ADS_SEARCH_COLUMN col;
/*.. omit set preference and execute … */
while( m_pSearch->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
{
   // Get the Name and display it in the list. 
    hr = m_pSearch->GetColumn( hSearch, pszAttr[0], &col );
    if ( SUCCEEDED(hr) )
    {
        printf("%S\n", col.pADsValues->CaseIgnoreString);
        m_pSearch->FreeColumn( &col );
    }
}
m_pSearch->CloseSearchHandle( hSearch );

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

IDirectorySearch, IDirectorySearch::GetColumn, ADSI Error Codes