Click here to Skip to main content
15,902,876 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: asynchronized I/O == multiplexing I/O? [modified] Pin
George_George25-Jul-06 2:06
George_George25-Jul-06 2:06 
QuestionSet Focus to Button? Pin
bosfan24-Jul-06 0:37
bosfan24-Jul-06 0:37 
AnswerRe: Set Focus to Button? Pin
toxcct24-Jul-06 0:41
toxcct24-Jul-06 0:41 
GeneralRe: Set Focus to Button? Pin
bosfan24-Jul-06 1:09
bosfan24-Jul-06 1:09 
AnswerRe: Set Focus to Button? Pin
_AnsHUMAN_ 24-Jul-06 0:42
_AnsHUMAN_ 24-Jul-06 0:42 
GeneralRe: Set Focus to Button? Pin
bosfan24-Jul-06 1:26
bosfan24-Jul-06 1:26 
QuestionReading text from where mouse is double clicked!!! Pin
_AnsHUMAN_ 24-Jul-06 0:20
_AnsHUMAN_ 24-Jul-06 0:20 
AnswerRe: Reading text from where mouse is double clicked!!! Pin
Programm3r24-Jul-06 0:31
Programm3r24-Jul-06 0:31 
AnswerRe: Reading text from where mouse is double clicked!!! Pin
David Crow24-Jul-06 3:08
David Crow24-Jul-06 3:08 
Questionread/ write to screen/ file Pin
tanarnelinistit24-Jul-06 0:05
tanarnelinistit24-Jul-06 0:05 
AnswerRe: read/ write to screen/ file Pin
Cedric Moonen24-Jul-06 0:14
Cedric Moonen24-Jul-06 0:14 
GeneralRe: read/ write to screen/ file Pin
tanarnelinistit24-Jul-06 0:18
tanarnelinistit24-Jul-06 0:18 
AnswerRe: read/ write to screen/ file Pin
normanS24-Jul-06 0:58
normanS24-Jul-06 0:58 
GeneralRe: read/ write to screen/ file Pin
tanarnelinistit24-Jul-06 1:16
tanarnelinistit24-Jul-06 1:16 
GeneralRe: read/ write to screen/ file Pin
normanS24-Jul-06 19:25
normanS24-Jul-06 19:25 
QuestionHow to hide process from being watched Pin
kflrei24-Jul-06 0:02
kflrei24-Jul-06 0:02 
AnswerRe: How to hide process from being watched Pin
Programm3r24-Jul-06 0:11
Programm3r24-Jul-06 0:11 
AnswerRe: How to hide process from being watched Pin
Programm3r24-Jul-06 0:17
Programm3r24-Jul-06 0:17 
QuestionIPC -- is it reliable ??? Pin
TamirC23-Jul-06 23:53
TamirC23-Jul-06 23:53 
AnswerRe: IPC -- is it reliable ??? Pin
ThatsAlok24-Jul-06 0:02
ThatsAlok24-Jul-06 0:02 
QuestionOnKillFocus() Pin
Taruni23-Jul-06 23:26
Taruni23-Jul-06 23:26 
AnswerRe: OnKillFocus() Pin
prasad_som24-Jul-06 1:53
prasad_som24-Jul-06 1:53 
AnswerRe: OnKillFocus() Pin
David Crow24-Jul-06 3:21
David Crow24-Jul-06 3:21 
QuestionGetting folder names Pin
ashokvishnu23-Jul-06 23:26
ashokvishnu23-Jul-06 23:26 
Hi Gurus,

I want to retrieve the sub directory names from a directory. I dont want the file names if any are present. Presented below is code I am working on. However FindFileData.cFileName is giving only the first letter of the directory. How do I correct this? Since I have to use the code for productions, any corrections or better sample code will be most welcome.

void GetSubFolderNames( LPCTSTR szFolderPath )
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind = INVALID_HANDLE_VALUE;
DWORD dwError;

hFind = FindFirstFile(szFolderPath, &FindFileData);

if (hFind == INVALID_HANDLE_VALUE)
{
printf ("Invalid file handle. Error is %u\n", GetLastError());
return (-1);
}
else
{
do
{
if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if ( !lstrcmp( FindFileData.cFileName, L"." )
|| !lstrcmp( FindFileData.cFileName, L".."))
{
//Do nothing for "." and ".." folders
}
else
{
CString fileName = FindFileData.cFileName;
printf ("First file name is %s\n", fileName);
}

}
} while (FindNextFile(hFind, &FindFileData) != 0) ;

dwError = GetLastError();
FindClose(hFind);
if (dwError != ERROR_NO_MORE_FILES)
{
printf ("FindNextFile error. Error is %u\n", dwError);
return (-1);
}
}
return (0);
}

Thanks

C++beginer

AnswerRe: Getting folder names Pin
Don Box23-Jul-06 23:35
Don Box23-Jul-06 23:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.