How can get all files from selected directory?
-
Hi all, In my application for browse directory if i select any directory than i want all files are selected from this directory. But here is one problem if i select any directory than it select only those file those are persent on the selected directory path.it not select files those are present inside the folder of folder on the selected directory path. Please help me for this. Any help or suggestions are appriciated. If possible please explain with example. Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
-
Hi all, In my application for browse directory if i select any directory than i want all files are selected from this directory. But here is one problem if i select any directory than it select only those file those are persent on the selected directory path.it not select files those are present inside the folder of folder on the selected directory path. Please help me for this. Any help or suggestions are appriciated. If possible please explain with example. Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
Don't know if there exists an API to directly achieve this. You can use FindFirstFile alongwith PathIsDirectory (if it is a directory get all the file names from it) and implement a recursive solution to get all the files from the parent as well as the child directories.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Hi all, In my application for browse directory if i select any directory than i want all files are selected from this directory. But here is one problem if i select any directory than it select only those file those are persent on the selected directory path.it not select files those are present inside the folder of folder on the selected directory path. Please help me for this. Any help or suggestions are appriciated. If possible please explain with example. Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
Except FindFirstFile you can use of DlgDirList for get files and folders.
-
Except FindFirstFile you can use of DlgDirList for get files and folders.
The DlgDirList function replaces the contents of a list box with the names of the subdirectories and files in a specified directory. so if the user does not have a list box at his disposal, this API won't be useful.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Hi all, In my application for browse directory if i select any directory than i want all files are selected from this directory. But here is one problem if i select any directory than it select only those file those are persent on the selected directory path.it not select files those are present inside the folder of folder on the selected directory path. Please help me for this. Any help or suggestions are appriciated. If possible please explain with example. Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
This function will return the directory contents in a vector of strings.
std::vector< std::wstring > GetDirectoryList( const std::wstring &strDirectory )
{
std::vector< std::wstring > contents;
WIN32_FIND_DATA data;
HANDLE hFind = FindFirstFile( (strDirectory + L"\\*").c_str() , &data);if ( hFind != INVALID\_HANDLE\_VALUE ) { do { contents.push\_back( data.cFileName ); } while ( FindNextFile( hFind , &data ) != 0 ); FindClose( hFind ); } return contents;
}