IFileDialog::GetResult method (shobjidl_core.h)

Gets the choice that the user made in the dialog.

Syntax

HRESULT GetResult(
  [out] IShellItem **ppsi
);

Parameters

[out] ppsi

Type: IShellItem**

The address of a pointer to an IShellItem that represents the user's choice.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

IFileDialog::GetResult can be called after the dialog has closed or during the handling of an OnFileOk event. Calling this method at any other time will fail. If multiple items were chosen, this method will fail. In the case of multiple items, call GetResults

Show must return a success code for a result to be available to IFileDialog::GetResult.

Requirements

Requirement Value
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)

See also

IFileDialog

IFileDialog::GetCurrentSelection