IDirectorySearch::GetNextColumnName method (iads.h)

The IDirectorySearch::GetNextColumnName method gets the name of the next column in the search result that contains data.

Syntax

HRESULT GetNextColumnName(
  ADS_SEARCH_HANDLE hSearchHandle,
  LPWSTR            *ppszColumnName
);

Parameters

hSearchHandle

Provides a handle to the search context.

ppszColumnName

Provides the address of a pointer to a method-allocated string containing the requested column name. If NULL, no subsequent rows contain data.

Return value

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

For other return values, see ADSI Error Codes.

Remarks

This method allocates sufficient memory for the column name, but the caller must call the FreeADsMem helper function to free this memory when it is no longer needed.

Examples

LPWSTR pszColumn;
m_pSearch->GetFirstRow( hSearch );
printf("Column names are: ");
while( m_pSearch->GetNextColumnName( hSearch, &pszColumn ) != S_ADS_NOMORE_COLUMNS )
{
   printf("%S ", pszColumn );
   FreeADsMem( pszColumn );
}

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header iads.h
DLL Activeds.dll; Adsldp.dll; Adsldpc.dll

See also

ADSI Error Codes

FreeADsMem

IDirectorySearch