Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to fill a List View Control using DlgDirList or DlgDirListComboBox?

Posted on 2004-10-25
2
Medium Priority
?
225 Views
Last Modified: 2013-11-20
How do I fill a List View Control using DlgDirList or DlgDirListComboBox?

I can fill a list box with this:

char szPath [255] = {"c:\\"};
int nResult = DlgDirList(szPath,IDC_LIST,IDC_DIRECTORY,DDL_DRIVES | DDL_DIRECTORY);

Can I do the same with a list view control?

thanks
0
Comment
Question by:galneweinhaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 12408145
Not by default.

However you can use CFileFind to find the files/directories and add the items individually to the list control.

  CFileFind finder;
   BOOL bWorking = finder.FindFile("*.*");
   while (bWorking)
   {
      bWorking = finder.FindNextFile();
      // do something with finder.GetFileName()
   }
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 12408726
Another thought.   You could also cheat.
Have a list or combo that is hidden.  Fill that as you  posted above.  Then loop throught the contents, get the string and use that as the item to insert into the list control.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question