IFileDialog::GetFileName method (shobjidl_core.h)

Retrieves the text currently entered in the dialog's File name edit box.

Syntax

HRESULT GetFileName(
  [out] LPWSTR *pszName
);

Parameters

[out] pszName

Type: WCHAR**

The address of a pointer to a buffer that, when this method returns successfully, receives the text.

Return value

Type: HRESULT

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

Remarks

The text in the File name edit box does not necessarily reflect the item the user chose. To get the item the user chose, use IFileDialog::GetResult.

The calling application is responsible for releasing the retrieved buffer by using the CoTaskMemFree function.

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)