Solved

EVC++: How to get a directory listing?

Posted on 2004-04-13
6
759 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

739 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