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 Mike Lewis 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
 
set right MAX_PATH, the member of WIN32_FIND_DATA what you pass to Find* dunctions. John Fill
1c.bmp


ivfmd@mail.md
 
set right MAX_PATH, the member of WIN32_FIND_DATA what you pass to Find* functions. John Fill
1c.bmp


ivfmd@mail.md
 
Is there a hint I can pass to the ClistBox to make it lfn without going thru the extra steps to add a cfilefind object?
 
I think you there exist a style of a list box(or a combo box) which do it automatically. But better is to use GetOpenFileName/GetSaveFileName for browsing. See also in MFC exist CFileFind object what does the same. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top