IColumnManager::GetColumns method

Gets an array of PROPERTYKEY structures that represent the columns that the view supports. Includes either all columns or only those currently visible.

Syntax

HRESULT GetColumns(
  CM_ENUM_FLAGS dwFlags,
  PROPERTYKEY   *rgkeyOrder,
  UINT          cColumns
);

Parameters

dwFlags

Type: CM_ENUM_FLAGS

A value from the CM_ENUM_FLAGS enumeration that specifies whether to show only visible columns or all columns regardless of visibility.

rgkeyOrder

Type: PROPERTYKEY*

On success, contains a pointer to an array of PROPERTYKEY structures that represent the columns.

cColumns

Type: UINT

The length of the rgkeyOrder array.

Return Value

Type: HRESULT

Returns one of the following values:

Return code Description
S_OK
Collection retrieved.
failure
All columns were not mapped to PROPERTYKEY structures.
E_INVALIDARG
The value in cColumns is inconsistent with the value in dwFlags.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
DLL Shell32.dll (version 5.0 or later)