Question

I'm trying to use the IShellFolder2.GetDefaultColumn function to get the default sort column that is recommended for a specific shell folder. But unfortunately, the function always fails with E_NOTIMPL (HResult -2147467263).

The method call looks like this:
hr := ishellfolder2.GetDefaultColumn(0, sortColumn, displayColumn);

The IShellFolder object is queried by using
SHBindToParent
or
ShellFolder.BindToObject
afterwards it's casted to an IShellFolder2.

The object is valid because it's successfully used for e.g. querying GetDetailsOf.

Is there anything I`m missing?
Thank you and best regards

Était-ce utile?

La solution

Answer from Microsoft:

The reason why IShellFolder2.GetDefaultColumn always returns E_NOTIMPL is following: Almost no shell folder implements this method. This means that this folder does not want to overwrite the defaut sort order. If this method succeeds, it returns a custom sort column that differs from the default sort column.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top