Share via


CFileDialog::GetFileName

Call this function to retrieve the name of the filename entered in the dialog box.

CString GetFileName( ) const;

Return Value

The name of the file.

Remarks

The name of the file includes both the prefix and the extension. For example, GetFileName will return "TEXT.DAT" for the file C:\FILES\TEXT.DAT.

If m_ofn.Flags has the OFN_ALLOWMULTISELECT flag set, you should call GetStartPosition and GetNextPathName to retrieve a file pathname.

Requirements

Header: afxdlgs.h

See Also

Reference

CFileDialog Class

Hierarchy Chart

CFileDialog::GetPathName

CFileDialog::GetStartPosition

CFileDialog::GetFileTitle