CRecentFileList::GetDisplayName

BOOL GetDisplayName( CString& strName, int nIndex, LPCTSTR lpszCurDir, int nCurDir, BOOL bAtLeastName = TRUE) const;

Return Value

FALSE if there is no filename at the specified index in the MRU (most recently used) file list.

Parameters

strName

Full path of the file whose name is to be displayed in the menu list of MRU files.

nIndex

Zero-based index of the file in the MRU file list.

lpszCurDir

String holding the current directory.

nCurDir

Length of the current directory string.

bAtLeastName

If nonzero, indicates that the base name of the file should be returned, even if it exceeds the maximum display length (passed as the nMaxDispLen parameter to the CRecentFileList constructor).

Remarks

Call this function to obtain a display name for a file in the MRU file list, for use in the menu display of the MRU list. If the file is in the current directory, the function leaves the directory off the display. If the filename is too long, the directory and extension are stripped. If the filename is still too long, the display name is set to an empty string unless bAtLeastName is nonzero.

CRecentFileList OverviewClass MembersHierarchy Chart

See Also   CRecentFileList::ReadList CRecentFileList::WriteList