Solved

EVC++: How to get a directory listing?

Posted on 2004-04-13
6
749 Views
Last Modified: 2009-07-29
Unlike its counterpart, eVC++ doesn't seem to support the following:

SendMessage(hCombobox, CB_DIR, (WPARAM)DDL_DIRECTORY | DDL_EXCLUSIVE, (LPARAM)FolderName);

The following are "undeclared identifiers":
CB_DIR
DDL_DIRECTORY
DDL_EXCLUSIVE

I am just looking for a way to get a directory/file listing. It does not necessarily have to involve a combo/list box, merely provide me with a directory listing. I'll change the number of points depending on the complexity of the answer. Thanks in advance.



0
Comment
Question by:HannibalL
6 Comments
 
LVL 4

Expert Comment

by:bkfirebird
ID: 10819027
0
 

Author Comment

by:HannibalL
ID: 10819252
I'm more looking for something which will give a string, array, or combo/list box a list of the folders and files in a specified path.
0
 
LVL 3

Expert Comment

by:akalmani
ID: 10821239
0
 
LVL 14

Accepted Solution

by:
Daniel Junges earned 100 total points
ID: 10822239

      WIN32_FIND_DATA FileData;
      HANDLE handle = FindFirstFile(L"*", &FileData);
      BOOL result = (handle!=INVALID_HANDLE_VALUE ? TRUE : FALSE);

      while( result == TRUE ){
                  CString file = FileData.cFileName;
                  ...
                  result = FindNextFile(handle, &FileData);
         }
         FindClose(handle);
0
 

Author Comment

by:HannibalL
ID: 11047094
Sorry, the question was not resolved, and I forgot to post anything. I'll dole out points to junges, seeming as he helped the most. The code still returned more errors than I know what to do with, but I will continue working on it.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

785 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