Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CListBox 8.3 Luggage

Status
Not open for further replies.

ahoodin

Programmer
Jul 25, 2001
48
US
I have a Listbox and do the commando: m_myListBox.Dir(); This return all files in the current directory to the Listbox. This works perfecly on Windows 2000 and I can see the whole filename. The problem is that when I run the program on Windows98 the filename looks like this: (Eg Directory) [docume~1] and not [documents]. I think this is for the filenames as well, I didn't see any files longer than 8 characters.

Is it something I can fix or will it not work for windows 98.

You can fill the list yourself (..but why..) using FindFirstFile() and
FindNextFile(), then adding the returned names to your listbox using
m_ctrlListBox.AddString(). But you shouldnt have to.

How can I get the CListbox::dir() function bring long file names into my listbox?

FWIW,

Asher
 
before passing WIN32_FIND_DATA to Find* functions set other MAX_PATH. See the place where it is defined, undefine it and redefine with other value. John Fill
1c.bmp


ivfmd@mail.md
 
Use GetFullPathName or GetLongPathName API function to convert to the full path name that you need. What you discover is specific to Win 9x as the article
"Common Issues: Long File and Printer Names" from MSDN says.

Also for more details on the issue read the article:
"File Name Conventions" from MSDN

Hope this helps, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top