Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Full path in MRU Recent File List

379 views
Skip to first unread message

Napalm

unread,
Apr 2, 2007, 1:32:20 AM4/2/07
to
Hello!
I have a Visual Studio .NET application and I have a list of most
recently used files under the menu item File. What makes me unhappy is
that only truncated path (e.g. D:\Projects\...\file.ext) is shown,
which makes the list quite useless.
IS THERE ANY WAY HOW TO DISPLAY FULL PATH IN THE LIST OF MOST RECENTLY
USED FILES?
Thank you for any help.
Jiri

David Wilkinson

unread,
Apr 2, 2007, 7:42:08 AM4/2/07
to
Napalm wrote:

Jiri:

I don't know if this would work for you, but what I do is show the full
path on the status bar. You can easily do this by overriding
CFrameWnd::GetMessageString() and testing for ID's in the range
ID_FILE_MRU_FILE1 through ID_FILE_MRU_FILE16.

David Wilkinson

Scott McPhillips [MVP]

unread,
Apr 2, 2007, 9:35:00 AM4/2/07
to

The displayed version of the file names is produced by the
CRecentFileList MFC class. You can derive a class from this and
override the CRecentFileList::UpdateMenu function. Replace its call to
GetDisplayName with something you write.

To use this new class in the app replace the standard call to
LoadStdProfileSettings with something like this:

m_pRecentFileList = new CYourMRUList(
0,
_T("Recent File List"),
_T("File%d"),
4, // 4 items on menu
200); // 200 char wide

m_pRecentFileList->ReadList();

--
Scott McPhillips [VC++ MVP]

Napalm

unread,
Apr 2, 2007, 11:21:59 AM4/2/07
to
On Apr 2, 3:35 pm, "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
wrote:

Thank you for your suggestions, I will try both approaches (status bar
or new class derived from CRecentFileList) and let know whether it
worked. Some of my applications are dialog based, so I might prefer
the solution with the new class.

Joseph M. Newcomer

unread,
Apr 2, 2007, 1:29:19 PM4/2/07
to
I consider the use of ... to be one of the truly great disasters that Microsoft has
foisted onto the world. It was done largely because they wanted to implement soft links
and couldn't, so had to come up with the truly awful paths such as My Documents being some
massively long string, and this was embarrassing. Instead of fixing the problem, they
made it impossible to get rational behavior in ALL cases.

For example, I very often have the kind of problems you have.

c:\ClientName\ProjectName\ProgramName\ComponentName\SomeFileName.cpp
and
c:\OtherClientName\ProjectName\DivisionName\ProgramName\ComponentName\SomeFileName.cpp

so OF COURSE both of these are displayed as

c:\...\SomeFileName.cpp
c:\...\SomeFileName.cpp

and it is therefore OBVIOUS which file is which!

It isn't limited to VS. For example, I have files with names like

i:\Courses\PowerPoint\Windows System Programming 14.ppt
i:\Courses\PowerPoint\Windows System Programming 15.ppt

which come out with displays like

i:\Courses\...\Windows System Program...
i:\Courses\...\Windows System Program...

which shows a degree of tastelessness and stupidity in the algorithm that does the
truncation that is mind-boggling to behold. It shows a lack of understanding of user
interfaces that is deep beyond simple incompetence and moves into the area of outright
malice.

Alas, they had neither the taste nor intelligence to allow users to turn this misfeature
off. These are the same idiots who think it makes sense to issue a message that says it
is unable to copy a file "NAME". Is in NAME.cpp? NAME.h? NAME.aps? NAME.clw? NAME.ncb?
NAME.rc? NAME.txt? [Experience indicates it is NAME.ncb, but the compulsion to protect me
from the information I critically need to do my work is the result of a number of
cascading bad decisions. I have already changed the setting that says to hide extensions,
but not only do they make bad decisions, they don't test the code to make sure that the
options are properly handled everywhere...and this has been a problem for YEARS]
joe

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

0 new messages