Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: month calendar doesn't react tha same on WinXP than on Win2K Pin
Gary R. Wheeler30-Apr-05 2:54
Gary R. Wheeler30-Apr-05 2:54 
GeneralNeed Help!!! ... File and registry monitoring by hooking registry Pin
29-Apr-05 22:35
suss29-Apr-05 22:35 
GeneralRe: Need Help!!! ... File and registry monitoring by hooking registry Pin
ThatsAlok29-Apr-05 23:34
ThatsAlok29-Apr-05 23:34 
GeneralConverting Dialog to PropertyPage during RunTime Pin
Yaron Abershitz29-Apr-05 22:08
Yaron Abershitz29-Apr-05 22:08 
GeneralRe: Converting Dialog to PropertyPage during RunTime Pin
PJ Arends30-Apr-05 11:50
professionalPJ Arends30-Apr-05 11:50 
GeneralSome questions about ADO Pin
brilliant10129-Apr-05 20:42
brilliant10129-Apr-05 20:42 
GeneralRe: Some questions about ADO Pin
S Douglas3-May-05 11:28
professionalS Douglas3-May-05 11:28 
GeneralDeleting a folder Pin
Vinaya29-Apr-05 18:40
Vinaya29-Apr-05 18:40 
Hi,

I created an application which creates a folder in the temp directory to store the temporary output files, at program startup. When I exit my application I want to delete the files as well as the folder. My application successfully deletes the files( I used DeleteFile() API), but not the directory. The RemoveDirectory() always fails. Why is it so? I have also tried using _rmdir() method.

void RemoveTempFolder(LPCTSTR dirName)
{
 basic_string<TCHAR> stFolder;
 BOOL bFinish = TRUE;
 HANDLE	hFind;
 WIN32_FIND_DATA pFindData;

 stFolder.assign(dirName);
 stFolder.append(_T("\\*.*"));
 if((hFind = FindFirstFile (stFolder.c_str(), &pFindData))==  INVALID_HANDLE_VALUE)
 {
  return ;
 }
 while(bFinish)
 {
  if(_tcsicmp(pFindData.cFileName,_T(".")) != 0 &&   _tcsicmp(pFindData.cFileName,_T("..")) != 0)
  {
   basic_string<TCHAR> sTemp;
   sTemp.assign(dirName);
   sTemp.append( _T("\\"));
   sTemp.append(pFindData.cFileName);
   DeleteFile(sTemp.c_str());
  } 
  bFinish = FindNextFile(hFind,&pFindData);
 }
 int nRet = RemoveDirectory(dirName);
 if(!nRet)
  DWORD dErr = GetLastError();
}


I also tried calling RemoveDirectory()from outside the function. Still the same result. Frown | :( Is there anything I am missing here?? Pls help.

Thanks,

Vini
GeneralRe: Deleting a folder Pin
22491729-Apr-05 19:56
22491729-Apr-05 19:56 
GeneralRe: Deleting a folder Pin
Vinaya29-Apr-05 20:47
Vinaya29-Apr-05 20:47 
GeneralRe: Deleting a folder Pin
David Crow30-Apr-05 3:52
David Crow30-Apr-05 3:52 
QuestionWhat font do you use when programming? Pin
followait29-Apr-05 18:13
followait29-Apr-05 18:13 
AnswerRe: What font do you use when programming? Pin
ThatsAlok29-Apr-05 20:04
ThatsAlok29-Apr-05 20:04 
AnswerRe: What font do you use when programming? Pin
David Crow30-Apr-05 3:54
David Crow30-Apr-05 3:54 
AnswerRe: What font do you use when programming? Pin
Ravi Bhavnani30-Apr-05 5:33
professionalRavi Bhavnani30-Apr-05 5:33 
AnswerRe: What font do you use when programming? Pin
PJ Arends30-Apr-05 9:16
professionalPJ Arends30-Apr-05 9:16 
AnswerRe: What font do you use when programming? Pin
Michael P Butler30-Apr-05 10:48
Michael P Butler30-Apr-05 10:48 
AnswerRe: What font do you use when programming? Pin
mark novak1-May-05 3:34
mark novak1-May-05 3:34 
AnswerRe: What font do you use when programming? Pin
cmk1-May-05 5:09
cmk1-May-05 5:09 
QuestionWhy does my MFC EXE fail to run in Win XP and Win 2000? Pin
Sstar29-Apr-05 18:00
Sstar29-Apr-05 18:00 
QuestionHOW TO DETACT MULTIPLE VGA CARDS IN VC++ Pin
King 149340029-Apr-05 17:29
King 149340029-Apr-05 17:29 
AnswerRe: HOW TO DETACT MULTIPLE VGA CARDS IN VC++ Pin
Anonymous29-Apr-05 20:22
Anonymous29-Apr-05 20:22 
Answerbut you are you shouting ???? Pin
Anonymous29-Apr-05 20:23
Anonymous29-Apr-05 20:23 
GeneralRe: but you are you shouting ???? Pin
ThatsAlok29-Apr-05 21:22
ThatsAlok29-Apr-05 21:22 
AnswerRe: HOW TO DETACT MULTIPLE VGA CARDS IN VC++ Pin
David Crow30-Apr-05 6:33
David Crow30-Apr-05 6:33 

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.